<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html xmlns:yui="http://yuilibrary.com/rdf/1.0/yui.rdf#">
<head>
    <meta http-equiv="content-type" content="text/html; charset=UTF-8" />
	<title>API: slider   Slider.js  (YUI Library)</title>

	<link rel="stylesheet" type="text/css" href="assets/reset-fonts-grids-min.css" />
	<link rel="stylesheet" type="text/css" href="assets/api.css" />

    <script type="text/javascript" src="assets/api-js"></script>
    <script type="text/javascript" src="assets/ac-js"></script>
</head>

<body id="yahoo-com">

<div id="doc3" class="yui-t2">
	<div id="hd">
        <h1><a href="http://developer.yahoo.com/yui/" title="Yahoo! UI Library">Yahoo! UI Library</a></h1>
        <h3>Slider Widget&nbsp; <span class="subtitle">2.7.0</span></h3>
        <a href="./index.html" title="Yahoo! UI Library">Yahoo! UI Library</a> 
            &gt; <a href="./module_slider.html" title="slider">slider</a>
                
                 &gt; Slider.js (source view) 
        <form onsubmit="return false">
            <div id="propertysearch">
                Search: <input autocomplete="off" id="searchinput" />
                <div id="searchresults">
                    &nbsp;
                </div>
            </div>
        </form>
	</div>

	<div id="bd">
		<div id="yui-main">
			<div class="yui-b">
            <form action="#" name="yui-classopts-form" method="get" id="yui-classopts-form">
                <fieldset>
                    <legend>Filters</legend>
                <span class="classopts"><input type="checkbox" name="show_private" id="show_private" /> <label for="show_private">Show Private</label></span>
                <span class="classopts"><input type="checkbox" name="show_protected" id="show_protected" /> <label for="show_protected">Show Protected</label></span>
                <span class="classopts"><input type="checkbox" name="show_deprecated" id="show_deprecated" /> <label for="show_deprecated">Show Deprecated</label></span>
                </fieldset>
            </form>

                    <div id="srcout">
                        <style>
                            #doc3 .classopts { display:none; }
                        </style>
<div class="highlight" ><pre><span class="c">/**</span>
<span class="c"> * The Slider component is a UI control that enables the user to adjust </span>
<span class="c"> * values in a finite range along one or two axes. Typically, the Slider </span>
<span class="c"> * control is used in a web application as a rich, visual replacement </span>
<span class="c"> * for an input box that takes a number as input. The Slider control can </span>
<span class="c"> * also easily accommodate a second dimension, providing x,y output for </span>
<span class="c"> * a selection point chosen from a rectangular region.</span>
<span class="c"> *</span>
<span class="c"> * @module    slider</span>
<span class="c"> * @title     Slider Widget</span>
<span class="c"> * @namespace YAHOO.widget</span>
<span class="c"> * @requires  yahoo,dom,dragdrop,event</span>
<span class="c"> * @optional  animation</span>
<span class="c"> */</span>
 <span class="o">(</span><span class="k">function</span> <span class="o">()</span> <span class="o">{</span>

<span class="k">var</span> <span class="nx">getXY</span> <span class="o">=</span> <span class="nx">YAHOO</span><span class="o">.</span><span class="nx">util</span><span class="o">.</span><span class="nx">Dom</span><span class="o">.</span><span class="nx">getXY</span><span class="o">,</span>
    <span class="nx">Event</span> <span class="o">=</span> <span class="nx">YAHOO</span><span class="o">.</span><span class="nx">util</span><span class="o">.</span><span class="nx">Event</span><span class="o">,</span>
    <span class="nx">_AS</span>   <span class="o">=</span> <span class="nb">Array</span><span class="o">.</span><span class="nx">prototype</span><span class="o">.</span><span class="nx">slice</span><span class="o">;</span>

<span class="c">/**</span>
<span class="c"> * A DragDrop implementation that can be used as a background for a</span>
<span class="c"> * slider.  It takes a reference to the thumb instance </span>
<span class="c"> * so it can delegate some of the events to it.  The goal is to make the </span>
<span class="c"> * thumb jump to the location on the background when the background is </span>
<span class="c"> * clicked.  </span>
<span class="c"> *</span>
<span class="c"> * @class Slider</span>
<span class="c"> * @extends YAHOO.util.DragDrop</span>
<span class="c"> * @uses YAHOO.util.EventProvider</span>
<span class="c"> * @constructor</span>
<span class="c"> * @param {String}      id     The id of the element linked to this instance</span>
<span class="c"> * @param {String}      sGroup The group of related DragDrop items</span>
<span class="c"> * @param {SliderThumb} oThumb The thumb for this slider</span>
<span class="c"> * @param {String}      sType  The type of slider (horiz, vert, region)</span>
<span class="c"> */</span>
<span class="k">function</span> <span class="nx">Slider</span><span class="o">(</span><span class="nx">sElementId</span><span class="o">,</span> <span class="nx">sGroup</span><span class="o">,</span> <span class="nx">oThumb</span><span class="o">,</span> <span class="nx">sType</span><span class="o">)</span> <span class="o">{</span>

    <span class="nx">Slider</span><span class="o">.</span><span class="nx">ANIM_AVAIL</span> <span class="o">=</span> <span class="o">(!</span><span class="nx">YAHOO</span><span class="o">.</span><span class="nx">lang</span><span class="o">.</span><span class="nx">isUndefined</span><span class="o">(</span><span class="nx">YAHOO</span><span class="o">.</span><span class="nx">util</span><span class="o">.</span><span class="nx">Anim</span><span class="o">));</span>

    <span class="k">if</span> <span class="o">(</span><span class="nx">sElementId</span><span class="o">)</span> <span class="o">{</span>
        <span class="k">this</span><span class="o">.</span><span class="nx">init</span><span class="o">(</span><span class="nx">sElementId</span><span class="o">,</span> <span class="nx">sGroup</span><span class="o">,</span> <span class="kc">true</span><span class="o">);</span>
        <span class="k">this</span><span class="o">.</span><span class="nx">initSlider</span><span class="o">(</span><span class="nx">sType</span><span class="o">);</span>
        <span class="k">this</span><span class="o">.</span><span class="nx">initThumb</span><span class="o">(</span><span class="nx">oThumb</span><span class="o">);</span>
    <span class="o">}</span>
<span class="o">}</span>

<span class="nx">YAHOO</span><span class="o">.</span><span class="nx">lang</span><span class="o">.</span><span class="nx">augmentObject</span><span class="o">(</span><span class="nx">Slider</span><span class="o">,{</span>
    <span class="c">/**</span>
<span class="c">     * Factory method for creating a horizontal slider</span>
<span class="c">     * @method YAHOO.widget.Slider.getHorizSlider</span>
<span class="c">     * @static</span>
<span class="c">     * @param {String} sBGElId the id of the slider&#39;s background element</span>
<span class="c">     * @param {String} sHandleElId the id of the thumb element</span>
<span class="c">     * @param {int} iLeft the number of pixels the element can move left</span>
<span class="c">     * @param {int} iRight the number of pixels the element can move right</span>
<span class="c">     * @param {int} iTickSize optional parameter for specifying that the element </span>
<span class="c">     * should move a certain number pixels at a time.</span>
<span class="c">     * @return {Slider} a horizontal slider control</span>
<span class="c">     */</span>
    <span class="nx">getHorizSlider</span> <span class="o">:</span> 
        <span class="k">function</span> <span class="o">(</span><span class="nx">sBGElId</span><span class="o">,</span> <span class="nx">sHandleElId</span><span class="o">,</span> <span class="nx">iLeft</span><span class="o">,</span> <span class="nx">iRight</span><span class="o">,</span> <span class="nx">iTickSize</span><span class="o">)</span> <span class="o">{</span>
            <span class="k">return</span> <span class="k">new</span> <span class="nx">Slider</span><span class="o">(</span><span class="nx">sBGElId</span><span class="o">,</span> <span class="nx">sBGElId</span><span class="o">,</span> 
                <span class="k">new</span> <span class="nx">YAHOO</span><span class="o">.</span><span class="nx">widget</span><span class="o">.</span><span class="nx">SliderThumb</span><span class="o">(</span><span class="nx">sHandleElId</span><span class="o">,</span> <span class="nx">sBGElId</span><span class="o">,</span> 
                                   <span class="nx">iLeft</span><span class="o">,</span> <span class="nx">iRight</span><span class="o">,</span> <span class="m">0</span><span class="o">,</span> <span class="m">0</span><span class="o">,</span> <span class="nx">iTickSize</span><span class="o">),</span> <span class="s2">&quot;horiz&quot;</span><span class="o">);</span>
    <span class="o">},</span>

    <span class="c">/**</span>
<span class="c">     * Factory method for creating a vertical slider</span>
<span class="c">     * @method YAHOO.widget.Slider.getVertSlider</span>
<span class="c">     * @static</span>
<span class="c">     * @param {String} sBGElId the id of the slider&#39;s background element</span>
<span class="c">     * @param {String} sHandleElId the id of the thumb element</span>
<span class="c">     * @param {int} iUp the number of pixels the element can move up</span>
<span class="c">     * @param {int} iDown the number of pixels the element can move down</span>
<span class="c">     * @param {int} iTickSize optional parameter for specifying that the element </span>
<span class="c">     * should move a certain number pixels at a time.</span>
<span class="c">     * @return {Slider} a vertical slider control</span>
<span class="c">     */</span>
    <span class="nx">getVertSlider</span> <span class="o">:</span>
        <span class="k">function</span> <span class="o">(</span><span class="nx">sBGElId</span><span class="o">,</span> <span class="nx">sHandleElId</span><span class="o">,</span> <span class="nx">iUp</span><span class="o">,</span> <span class="nx">iDown</span><span class="o">,</span> <span class="nx">iTickSize</span><span class="o">)</span> <span class="o">{</span>
            <span class="k">return</span> <span class="k">new</span> <span class="nx">Slider</span><span class="o">(</span><span class="nx">sBGElId</span><span class="o">,</span> <span class="nx">sBGElId</span><span class="o">,</span> 
                <span class="k">new</span> <span class="nx">YAHOO</span><span class="o">.</span><span class="nx">widget</span><span class="o">.</span><span class="nx">SliderThumb</span><span class="o">(</span><span class="nx">sHandleElId</span><span class="o">,</span> <span class="nx">sBGElId</span><span class="o">,</span> <span class="m">0</span><span class="o">,</span> <span class="m">0</span><span class="o">,</span> 
                                   <span class="nx">iUp</span><span class="o">,</span> <span class="nx">iDown</span><span class="o">,</span> <span class="nx">iTickSize</span><span class="o">),</span> <span class="s2">&quot;vert&quot;</span><span class="o">);</span>
    <span class="o">},</span>

    <span class="c">/**</span>
<span class="c">     * Factory method for creating a slider region like the one in the color</span>
<span class="c">     * picker example</span>
<span class="c">     * @method YAHOO.widget.Slider.getSliderRegion</span>
<span class="c">     * @static</span>
<span class="c">     * @param {String} sBGElId the id of the slider&#39;s background element</span>
<span class="c">     * @param {String} sHandleElId the id of the thumb element</span>
<span class="c">     * @param {int} iLeft the number of pixels the element can move left</span>
<span class="c">     * @param {int} iRight the number of pixels the element can move right</span>
<span class="c">     * @param {int} iUp the number of pixels the element can move up</span>
<span class="c">     * @param {int} iDown the number of pixels the element can move down</span>
<span class="c">     * @param {int} iTickSize optional parameter for specifying that the element </span>
<span class="c">     * should move a certain number pixels at a time.</span>
<span class="c">     * @return {Slider} a slider region control</span>
<span class="c">     */</span>
    <span class="nx">getSliderRegion</span> <span class="o">:</span> 
        <span class="k">function</span> <span class="o">(</span><span class="nx">sBGElId</span><span class="o">,</span> <span class="nx">sHandleElId</span><span class="o">,</span> <span class="nx">iLeft</span><span class="o">,</span> <span class="nx">iRight</span><span class="o">,</span> <span class="nx">iUp</span><span class="o">,</span> <span class="nx">iDown</span><span class="o">,</span> <span class="nx">iTickSize</span><span class="o">)</span> <span class="o">{</span>
            <span class="k">return</span> <span class="k">new</span> <span class="nx">Slider</span><span class="o">(</span><span class="nx">sBGElId</span><span class="o">,</span> <span class="nx">sBGElId</span><span class="o">,</span> 
                <span class="k">new</span> <span class="nx">YAHOO</span><span class="o">.</span><span class="nx">widget</span><span class="o">.</span><span class="nx">SliderThumb</span><span class="o">(</span><span class="nx">sHandleElId</span><span class="o">,</span> <span class="nx">sBGElId</span><span class="o">,</span> <span class="nx">iLeft</span><span class="o">,</span> <span class="nx">iRight</span><span class="o">,</span> 
                                   <span class="nx">iUp</span><span class="o">,</span> <span class="nx">iDown</span><span class="o">,</span> <span class="nx">iTickSize</span><span class="o">),</span> <span class="s2">&quot;region&quot;</span><span class="o">);</span>
    <span class="o">},</span>

    <span class="c">/**</span>
<span class="c">     * Constant for valueChangeSource, indicating that the user clicked or</span>
<span class="c">     * dragged the slider to change the value.</span>
<span class="c">     * @property Slider.SOURCE_UI_EVENT</span>
<span class="c">     * @final</span>
<span class="c">     * @static</span>
<span class="c">     * @default 1</span>
<span class="c">     */</span>
    <span class="nx">SOURCE_UI_EVENT</span> <span class="o">:</span> <span class="m">1</span><span class="o">,</span>

    <span class="c">/**</span>
<span class="c">     * Constant for valueChangeSource, indicating that the value was altered</span>
<span class="c">     * by a programmatic call to setValue/setRegionValue.</span>
<span class="c">     * @property Slider.SOURCE_SET_VALUE</span>
<span class="c">     * @final</span>
<span class="c">     * @static</span>
<span class="c">     * @default 2</span>
<span class="c">     */</span>
    <span class="nx">SOURCE_SET_VALUE</span> <span class="o">:</span> <span class="m">2</span><span class="o">,</span>

    <span class="c">/**</span>
<span class="c">     * Constant for valueChangeSource, indicating that the value was altered</span>
<span class="c">     * by hitting any of the supported keyboard characters.</span>
<span class="c">     * @property Slider.SOURCE_KEY_EVENT</span>
<span class="c">     * @final</span>
<span class="c">     * @static</span>
<span class="c">     * @default 2</span>
<span class="c">     */</span>
    <span class="nx">SOURCE_KEY_EVENT</span> <span class="o">:</span> <span class="m">3</span><span class="o">,</span>

    <span class="c">/**</span>
<span class="c">     * By default, animation is available if the animation utility is detected.</span>
<span class="c">     * @property Slider.ANIM_AVAIL</span>
<span class="c">     * @static</span>
<span class="c">     * @type boolean</span>
<span class="c">     */</span>
    <span class="nx">ANIM_AVAIL</span> <span class="o">:</span> <span class="kc">false</span>
<span class="o">},</span><span class="kc">true</span><span class="o">);</span>

<span class="nx">YAHOO</span><span class="o">.</span><span class="nx">extend</span><span class="o">(</span><span class="nx">Slider</span><span class="o">,</span> <span class="nx">YAHOO</span><span class="o">.</span><span class="nx">util</span><span class="o">.</span><span class="nx">DragDrop</span><span class="o">,</span> <span class="o">{</span>

    <span class="c">/**</span>
<span class="c">     * Tracks the state of the mouse button to aid in when events are fired.</span>
<span class="c">     *</span>
<span class="c">     * @property _mouseDown</span>
<span class="c">     * @type boolean</span>
<span class="c">     * @default false</span>
<span class="c">     * @private</span>
<span class="c">     */</span>
    <span class="nx">_mouseDown</span> <span class="o">:</span> <span class="kc">false</span><span class="o">,</span>

    <span class="c">/**</span>
<span class="c">     * Override the default setting of dragOnly to true.</span>
<span class="c">     * @property dragOnly</span>
<span class="c">     * @type boolean</span>
<span class="c">     * @default true</span>
<span class="c">     */</span>
    <span class="nx">dragOnly</span> <span class="o">:</span> <span class="kc">true</span><span class="o">,</span>

    <span class="c">/**</span>
<span class="c">     * Initializes the slider.  Executed in the constructor</span>
<span class="c">     * @method initSlider</span>
<span class="c">     * @param {string} sType the type of slider (horiz, vert, region)</span>
<span class="c">     */</span>
    <span class="nx">initSlider</span><span class="o">:</span> <span class="k">function</span><span class="o">(</span><span class="nx">sType</span><span class="o">)</span> <span class="o">{</span>

        <span class="c">/**</span>
<span class="c">         * The type of the slider (horiz, vert, region)</span>
<span class="c">         * @property type</span>
<span class="c">         * @type string</span>
<span class="c">         */</span>
        <span class="k">this</span><span class="o">.</span><span class="nx">type</span> <span class="o">=</span> <span class="nx">sType</span><span class="o">;</span>

        <span class="c">//this.removeInvalidHandleType(&quot;A&quot;);</span>
<span class="c"></span>
        <span class="k">this</span><span class="o">.</span><span class="nx">logger</span> <span class="o">=</span> <span class="k">new</span> <span class="nx">YAHOO</span><span class="o">.</span><span class="nx">widget</span><span class="o">.</span><span class="nx">LogWriter</span><span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">toString</span><span class="o">());</span>

        <span class="c">/**</span>
<span class="c">         * Event the fires when the value of the control changes.  If </span>
<span class="c">         * the control is animated the event will fire every point</span>
<span class="c">         * along the way.</span>
<span class="c">         * @event change</span>
<span class="c">         * @param {int} newOffset|x the new offset for normal sliders, or the new</span>
<span class="c">         *                          x offset for region sliders</span>
<span class="c">         * @param {int} y the number of pixels the thumb has moved on the y axis</span>
<span class="c">         *                (region sliders only)</span>
<span class="c">         */</span>
        <span class="k">this</span><span class="o">.</span><span class="nx">createEvent</span><span class="o">(</span><span class="s2">&quot;change&quot;</span><span class="o">,</span> <span class="k">this</span><span class="o">);</span>

        <span class="c">/**</span>
<span class="c">         * Event that fires at the beginning of a slider thumb move.</span>
<span class="c">         * @event slideStart</span>
<span class="c">         */</span>
        <span class="k">this</span><span class="o">.</span><span class="nx">createEvent</span><span class="o">(</span><span class="s2">&quot;slideStart&quot;</span><span class="o">,</span> <span class="k">this</span><span class="o">);</span>

        <span class="c">/**</span>
<span class="c">         * Event that fires at the end of a slider thumb move</span>
<span class="c">         * @event slideEnd</span>
<span class="c">         */</span>
        <span class="k">this</span><span class="o">.</span><span class="nx">createEvent</span><span class="o">(</span><span class="s2">&quot;slideEnd&quot;</span><span class="o">,</span> <span class="k">this</span><span class="o">);</span>

        <span class="c">/**</span>
<span class="c">         * Overrides the isTarget property in YAHOO.util.DragDrop</span>
<span class="c">         * @property isTarget</span>
<span class="c">         * @private</span>
<span class="c">         */</span>
        <span class="k">this</span><span class="o">.</span><span class="nx">isTarget</span> <span class="o">=</span> <span class="kc">false</span><span class="o">;</span>
    
        <span class="c">/**</span>
<span class="c">         * Flag that determines if the thumb will animate when moved</span>
<span class="c">         * @property animate</span>
<span class="c">         * @type boolean</span>
<span class="c">         */</span>
        <span class="k">this</span><span class="o">.</span><span class="nx">animate</span> <span class="o">=</span> <span class="nx">Slider</span><span class="o">.</span><span class="nx">ANIM_AVAIL</span><span class="o">;</span>

        <span class="c">/**</span>
<span class="c">         * Set to false to disable a background click thumb move</span>
<span class="c">         * @property backgroundEnabled</span>
<span class="c">         * @type boolean</span>
<span class="c">         */</span>
        <span class="k">this</span><span class="o">.</span><span class="nx">backgroundEnabled</span> <span class="o">=</span> <span class="kc">true</span><span class="o">;</span>

        <span class="c">/**</span>
<span class="c">         * Adjustment factor for tick animation, the more ticks, the</span>
<span class="c">         * faster the animation (by default)</span>
<span class="c">         * @property tickPause</span>
<span class="c">         * @type int</span>
<span class="c">         */</span>
        <span class="k">this</span><span class="o">.</span><span class="nx">tickPause</span> <span class="o">=</span> <span class="m">40</span><span class="o">;</span>

        <span class="c">/**</span>
<span class="c">         * Enables the arrow, home and end keys, defaults to true.</span>
<span class="c">         * @property enableKeys</span>
<span class="c">         * @type boolean</span>
<span class="c">         */</span>
        <span class="k">this</span><span class="o">.</span><span class="nx">enableKeys</span> <span class="o">=</span> <span class="kc">true</span><span class="o">;</span>

        <span class="c">/**</span>
<span class="c">         * Specifies the number of pixels the arrow keys will move the slider.</span>
<span class="c">         * Default is 20.</span>
<span class="c">         * @property keyIncrement</span>
<span class="c">         * @type int</span>
<span class="c">         */</span>
        <span class="k">this</span><span class="o">.</span><span class="nx">keyIncrement</span> <span class="o">=</span> <span class="m">20</span><span class="o">;</span>

        <span class="c">/**</span>
<span class="c">         * moveComplete is set to true when the slider has moved to its final</span>
<span class="c">         * destination.  For animated slider, this value can be checked in </span>
<span class="c">         * the onChange handler to make it possible to execute logic only</span>
<span class="c">         * when the move is complete rather than at all points along the way.</span>
<span class="c">         * Deprecated because this flag is only useful when the background is</span>
<span class="c">         * clicked and the slider is animated.  If the user drags the thumb,</span>
<span class="c">         * the flag is updated when the drag is over ... the final onDrag event</span>
<span class="c">         * fires before the mouseup the ends the drag, so the implementer will</span>
<span class="c">         * never see it.</span>
<span class="c">         *</span>
<span class="c">         * @property moveComplete</span>
<span class="c">         * @type Boolean</span>
<span class="c">         * @deprecated use the slideEnd event instead</span>
<span class="c">         */</span>
        <span class="k">this</span><span class="o">.</span><span class="nx">moveComplete</span> <span class="o">=</span> <span class="kc">true</span><span class="o">;</span>

        <span class="c">/**</span>
<span class="c">         * If animation is configured, specifies the length of the animation</span>
<span class="c">         * in seconds.</span>
<span class="c">         * @property animationDuration</span>
<span class="c">         * @type int</span>
<span class="c">         * @default 0.2</span>
<span class="c">         */</span>
        <span class="k">this</span><span class="o">.</span><span class="nx">animationDuration</span> <span class="o">=</span> <span class="m">0</span><span class="o">.</span><span class="m">2</span><span class="o">;</span>

        <span class="c">/**</span>
<span class="c">         * Constant for valueChangeSource, indicating that the user clicked or</span>
<span class="c">         * dragged the slider to change the value.</span>
<span class="c">         * @property SOURCE_UI_EVENT</span>
<span class="c">         * @final</span>
<span class="c">         * @default 1</span>
<span class="c">         * @deprecated use static Slider.SOURCE_UI_EVENT</span>
<span class="c">         */</span>
        <span class="k">this</span><span class="o">.</span><span class="nx">SOURCE_UI_EVENT</span> <span class="o">=</span> <span class="m">1</span><span class="o">;</span>

        <span class="c">/**</span>
<span class="c">         * Constant for valueChangeSource, indicating that the value was altered</span>
<span class="c">         * by a programmatic call to setValue/setRegionValue.</span>
<span class="c">         * @property SOURCE_SET_VALUE</span>
<span class="c">         * @final</span>
<span class="c">         * @default 2</span>
<span class="c">         * @deprecated use static Slider.SOURCE_SET_VALUE</span>
<span class="c">         */</span>
        <span class="k">this</span><span class="o">.</span><span class="nx">SOURCE_SET_VALUE</span> <span class="o">=</span> <span class="m">2</span><span class="o">;</span>

        <span class="c">/**</span>
<span class="c">         * When the slider value changes, this property is set to identify where</span>
<span class="c">         * the update came from.  This will be either 1, meaning the slider was</span>
<span class="c">         * clicked or dragged, or 2, meaning that it was set via a setValue() call.</span>
<span class="c">         * This can be used within event handlers to apply some of the logic only</span>
<span class="c">         * when dealing with one source or another.</span>
<span class="c">         * @property valueChangeSource</span>
<span class="c">         * @type int</span>
<span class="c">         * @since 2.3.0</span>
<span class="c">         */</span>
        <span class="k">this</span><span class="o">.</span><span class="nx">valueChangeSource</span> <span class="o">=</span> <span class="m">0</span><span class="o">;</span>

        <span class="c">/**</span>
<span class="c">         * Indicates whether or not events will be supressed for the current</span>
<span class="c">         * slide operation</span>
<span class="c">         * @property _silent</span>
<span class="c">         * @type boolean</span>
<span class="c">         * @private</span>
<span class="c">         */</span>
        <span class="k">this</span><span class="o">.</span><span class="nx">_silent</span> <span class="o">=</span> <span class="kc">false</span><span class="o">;</span>

        <span class="c">/**</span>
<span class="c">         * Saved offset used to protect against NaN problems when slider is</span>
<span class="c">         * set to display:none</span>
<span class="c">         * @property lastOffset</span>
<span class="c">         * @type [int, int]</span>
<span class="c">         */</span>
        <span class="k">this</span><span class="o">.</span><span class="nx">lastOffset</span> <span class="o">=</span> <span class="o">[</span><span class="m">0</span><span class="o">,</span><span class="m">0</span><span class="o">];</span>
    <span class="o">},</span>

    <span class="c">/**</span>
<span class="c">     * Initializes the slider&#39;s thumb. Executed in the constructor.</span>
<span class="c">     * @method initThumb</span>
<span class="c">     * @param {YAHOO.widget.SliderThumb} t the slider thumb</span>
<span class="c">     */</span>
    <span class="nx">initThumb</span><span class="o">:</span> <span class="k">function</span><span class="o">(</span><span class="nx">t</span><span class="o">)</span> <span class="o">{</span>

        <span class="k">var</span> <span class="nx">self</span> <span class="o">=</span> <span class="k">this</span><span class="o">;</span>

        <span class="c">/**</span>
<span class="c">         * A YAHOO.widget.SliderThumb instance that we will use to </span>
<span class="c">         * reposition the thumb when the background is clicked</span>
<span class="c">         * @property thumb</span>
<span class="c">         * @type YAHOO.widget.SliderThumb</span>
<span class="c">         */</span>
        <span class="k">this</span><span class="o">.</span><span class="nx">thumb</span> <span class="o">=</span> <span class="nx">t</span><span class="o">;</span>

        <span class="nx">t</span><span class="o">.</span><span class="nx">cacheBetweenDrags</span> <span class="o">=</span> <span class="kc">true</span><span class="o">;</span>

        <span class="k">if</span> <span class="o">(</span><span class="nx">t</span><span class="o">.</span><span class="nx">_isHoriz</span> <span class="o">&amp;&amp;</span> <span class="nx">t</span><span class="o">.</span><span class="nx">xTicks</span> <span class="o">&amp;&amp;</span> <span class="nx">t</span><span class="o">.</span><span class="nx">xTicks</span><span class="o">.</span><span class="nx">length</span><span class="o">)</span> <span class="o">{</span>
            <span class="k">this</span><span class="o">.</span><span class="nx">tickPause</span> <span class="o">=</span> <span class="nb">Math</span><span class="o">.</span><span class="nx">round</span><span class="o">(</span><span class="m">360</span> <span class="o">/</span> <span class="nx">t</span><span class="o">.</span><span class="nx">xTicks</span><span class="o">.</span><span class="nx">length</span><span class="o">);</span>
        <span class="o">}</span> <span class="k">else</span> <span class="k">if</span> <span class="o">(</span><span class="nx">t</span><span class="o">.</span><span class="nx">yTicks</span> <span class="o">&amp;&amp;</span> <span class="nx">t</span><span class="o">.</span><span class="nx">yTicks</span><span class="o">.</span><span class="nx">length</span><span class="o">)</span> <span class="o">{</span>
            <span class="k">this</span><span class="o">.</span><span class="nx">tickPause</span> <span class="o">=</span> <span class="nb">Math</span><span class="o">.</span><span class="nx">round</span><span class="o">(</span><span class="m">360</span> <span class="o">/</span> <span class="nx">t</span><span class="o">.</span><span class="nx">yTicks</span><span class="o">.</span><span class="nx">length</span><span class="o">);</span>
        <span class="o">}</span>

        <span class="k">this</span><span class="o">.</span><span class="nx">logger</span><span class="o">.</span><span class="nx">log</span><span class="o">(</span><span class="s2">&quot;tickPause: &quot;</span> <span class="o">+</span> <span class="k">this</span><span class="o">.</span><span class="nx">tickPause</span><span class="o">);</span>

        <span class="c">// delegate thumb methods</span>
<span class="c"></span>        <span class="nx">t</span><span class="o">.</span><span class="nx">onAvailable</span> <span class="o">=</span> <span class="k">function</span><span class="o">()</span> <span class="o">{</span> 
                <span class="k">return</span> <span class="nx">self</span><span class="o">.</span><span class="nx">setStartSliderState</span><span class="o">();</span> 
            <span class="o">};</span>
        <span class="nx">t</span><span class="o">.</span><span class="nx">onMouseDown</span> <span class="o">=</span> <span class="k">function</span> <span class="o">()</span> <span class="o">{</span> 
                <span class="nx">self</span><span class="o">.</span><span class="nx">_mouseDown</span> <span class="o">=</span> <span class="kc">true</span><span class="o">;</span>
                <span class="nx">self</span><span class="o">.</span><span class="nx">logger</span><span class="o">.</span><span class="nx">log</span><span class="o">(</span><span class="s1">&#39;thumb mousedown&#39;</span><span class="o">);</span>
                <span class="k">return</span> <span class="nx">self</span><span class="o">.</span><span class="nx">focus</span><span class="o">();</span> 
            <span class="o">};</span>
        <span class="nx">t</span><span class="o">.</span><span class="nx">startDrag</span> <span class="o">=</span> <span class="k">function</span><span class="o">()</span> <span class="o">{</span> 
                <span class="nx">self</span><span class="o">.</span><span class="nx">logger</span><span class="o">.</span><span class="nx">log</span><span class="o">(</span><span class="s1">&#39;thumb startDrag&#39;</span><span class="o">);</span>
                <span class="nx">self</span><span class="o">.</span><span class="nx">_slideStart</span><span class="o">();</span> 
            <span class="o">};</span>
        <span class="nx">t</span><span class="o">.</span><span class="nx">onDrag</span> <span class="o">=</span> <span class="k">function</span><span class="o">()</span> <span class="o">{</span> 
                <span class="nx">self</span><span class="o">.</span><span class="nx">logger</span><span class="o">.</span><span class="nx">log</span><span class="o">(</span><span class="s1">&#39;thumb drag&#39;</span><span class="o">);</span>
                <span class="nx">self</span><span class="o">.</span><span class="nx">fireEvents</span><span class="o">(</span><span class="kc">true</span><span class="o">);</span> 
            <span class="o">};</span>
        <span class="nx">t</span><span class="o">.</span><span class="nx">onMouseUp</span> <span class="o">=</span> <span class="k">function</span><span class="o">()</span> <span class="o">{</span> 
                <span class="nx">self</span><span class="o">.</span><span class="nx">thumbMouseUp</span><span class="o">();</span> 
            <span class="o">};</span>

    <span class="o">},</span>

    <span class="c">/**</span>
<span class="c">     * Executed when the slider element is available</span>
<span class="c">     * @method onAvailable</span>
<span class="c">     */</span>
    <span class="nx">onAvailable</span><span class="o">:</span> <span class="k">function</span><span class="o">()</span> <span class="o">{</span>
        <span class="k">this</span><span class="o">.</span><span class="nx">_bindKeyEvents</span><span class="o">();</span>
    <span class="o">},</span>
 
    <span class="c">/**</span>
<span class="c">     * Sets up the listeners for keydown and key press events.</span>
<span class="c">     *</span>
<span class="c">     * @method _bindKeyEvents</span>
<span class="c">     * @protected</span>
<span class="c">     */</span>
    <span class="nx">_bindKeyEvents</span> <span class="o">:</span> <span class="k">function</span> <span class="o">()</span> <span class="o">{</span>
        <span class="nx">Event</span><span class="o">.</span><span class="nx">on</span><span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">id</span><span class="o">,</span> <span class="s2">&quot;keydown&quot;</span><span class="o">,</span>  <span class="k">this</span><span class="o">.</span><span class="nx">handleKeyDown</span><span class="o">,</span>  <span class="k">this</span><span class="o">,</span> <span class="kc">true</span><span class="o">);</span>
        <span class="nx">Event</span><span class="o">.</span><span class="nx">on</span><span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">id</span><span class="o">,</span> <span class="s2">&quot;keypress&quot;</span><span class="o">,</span> <span class="k">this</span><span class="o">.</span><span class="nx">handleKeyPress</span><span class="o">,</span> <span class="k">this</span><span class="o">,</span> <span class="kc">true</span><span class="o">);</span>
    <span class="o">},</span>

    <span class="c">/**</span>
<span class="c">     * Executed when a keypress event happens with the control focused.</span>
<span class="c">     * Prevents the default behavior for navigation keys.  The actual</span>
<span class="c">     * logic for moving the slider thumb in response to a key event</span>
<span class="c">     * happens in handleKeyDown.</span>
<span class="c">     * @param {Event} e the keypress event</span>
<span class="c">     */</span>
    <span class="nx">handleKeyPress</span><span class="o">:</span> <span class="k">function</span><span class="o">(</span><span class="nx">e</span><span class="o">)</span> <span class="o">{</span>
        <span class="k">if</span> <span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">enableKeys</span><span class="o">)</span> <span class="o">{</span>
            <span class="k">var</span> <span class="nx">kc</span> <span class="o">=</span> <span class="nx">Event</span><span class="o">.</span><span class="nx">getCharCode</span><span class="o">(</span><span class="nx">e</span><span class="o">);</span>

            <span class="nx">switch</span> <span class="o">(</span><span class="nx">kc</span><span class="o">)</span> <span class="o">{</span>
                <span class="nx">case</span> <span class="m">0</span><span class="nx">x25</span><span class="o">:</span> <span class="c">// left</span>
<span class="c"></span>                <span class="nx">case</span> <span class="m">0</span><span class="nx">x26</span><span class="o">:</span> <span class="c">// up</span>
<span class="c"></span>                <span class="nx">case</span> <span class="m">0</span><span class="nx">x27</span><span class="o">:</span> <span class="c">// right</span>
<span class="c"></span>                <span class="nx">case</span> <span class="m">0</span><span class="nx">x28</span><span class="o">:</span> <span class="c">// down</span>
<span class="c"></span>                <span class="nx">case</span> <span class="m">0</span><span class="nx">x24</span><span class="o">:</span> <span class="c">// home</span>
<span class="c"></span>                <span class="nx">case</span> <span class="m">0</span><span class="nx">x23</span><span class="o">:</span> <span class="c">// end</span>
<span class="c"></span>                    <span class="nx">Event</span><span class="o">.</span><span class="nx">preventDefault</span><span class="o">(</span><span class="nx">e</span><span class="o">);</span>
                    <span class="k">break</span><span class="o">;</span>
                <span class="nx">default</span><span class="o">:</span>
            <span class="o">}</span>
        <span class="o">}</span>
    <span class="o">},</span>

    <span class="c">/**</span>
<span class="c">     * Executed when a keydown event happens with the control focused.</span>
<span class="c">     * Updates the slider value and display when the keypress is an</span>
<span class="c">     * arrow key, home, or end as long as enableKeys is set to true.</span>
<span class="c">     * @param {Event} e the keydown event</span>
<span class="c">     */</span>
    <span class="nx">handleKeyDown</span><span class="o">:</span> <span class="k">function</span><span class="o">(</span><span class="nx">e</span><span class="o">)</span> <span class="o">{</span>
        <span class="k">if</span> <span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">enableKeys</span><span class="o">)</span> <span class="o">{</span>
            <span class="k">var</span> <span class="nx">kc</span> <span class="o">=</span> <span class="nx">Event</span><span class="o">.</span><span class="nx">getCharCode</span><span class="o">(</span><span class="nx">e</span><span class="o">),</span>
                <span class="nx">t</span>  <span class="o">=</span> <span class="k">this</span><span class="o">.</span><span class="nx">thumb</span><span class="o">,</span>
                <span class="nx">h</span>  <span class="o">=</span> <span class="k">this</span><span class="o">.</span><span class="nx">getXValue</span><span class="o">(),</span>
                <span class="nx">v</span>  <span class="o">=</span> <span class="k">this</span><span class="o">.</span><span class="nx">getYValue</span><span class="o">(),</span>
                <span class="nx">changeValue</span> <span class="o">=</span> <span class="kc">true</span><span class="o">;</span>

            <span class="nx">switch</span> <span class="o">(</span><span class="nx">kc</span><span class="o">)</span> <span class="o">{</span>

                <span class="c">// left</span>
<span class="c"></span>                <span class="nx">case</span> <span class="m">0</span><span class="nx">x25</span><span class="o">:</span> <span class="nx">h</span> <span class="o">-=</span> <span class="k">this</span><span class="o">.</span><span class="nx">keyIncrement</span><span class="o">;</span> <span class="k">break</span><span class="o">;</span>

                <span class="c">// up</span>
<span class="c"></span>                <span class="nx">case</span> <span class="m">0</span><span class="nx">x26</span><span class="o">:</span> <span class="nx">v</span> <span class="o">-=</span> <span class="k">this</span><span class="o">.</span><span class="nx">keyIncrement</span><span class="o">;</span> <span class="k">break</span><span class="o">;</span>

                <span class="c">// right</span>
<span class="c"></span>                <span class="nx">case</span> <span class="m">0</span><span class="nx">x27</span><span class="o">:</span> <span class="nx">h</span> <span class="o">+=</span> <span class="k">this</span><span class="o">.</span><span class="nx">keyIncrement</span><span class="o">;</span> <span class="k">break</span><span class="o">;</span>

                <span class="c">// down</span>
<span class="c"></span>                <span class="nx">case</span> <span class="m">0</span><span class="nx">x28</span><span class="o">:</span> <span class="nx">v</span> <span class="o">+=</span> <span class="k">this</span><span class="o">.</span><span class="nx">keyIncrement</span><span class="o">;</span> <span class="k">break</span><span class="o">;</span>

                <span class="c">// home</span>
<span class="c"></span>                <span class="nx">case</span> <span class="m">0</span><span class="nx">x24</span><span class="o">:</span> <span class="nx">h</span> <span class="o">=</span> <span class="nx">t</span><span class="o">.</span><span class="nx">leftConstraint</span><span class="o">;</span>    
                           <span class="nx">v</span> <span class="o">=</span> <span class="nx">t</span><span class="o">.</span><span class="nx">topConstraint</span><span class="o">;</span>    
                           <span class="k">break</span><span class="o">;</span>

                <span class="c">// end</span>
<span class="c"></span>                <span class="nx">case</span> <span class="m">0</span><span class="nx">x23</span><span class="o">:</span> <span class="nx">h</span> <span class="o">=</span> <span class="nx">t</span><span class="o">.</span><span class="nx">rightConstraint</span><span class="o">;</span> 
                           <span class="nx">v</span> <span class="o">=</span> <span class="nx">t</span><span class="o">.</span><span class="nx">bottomConstraint</span><span class="o">;</span>    
                           <span class="k">break</span><span class="o">;</span>

                <span class="nx">default</span><span class="o">:</span>   <span class="nx">changeValue</span> <span class="o">=</span> <span class="kc">false</span><span class="o">;</span>
            <span class="o">}</span>

            <span class="k">if</span> <span class="o">(</span><span class="nx">changeValue</span><span class="o">)</span> <span class="o">{</span>
                <span class="k">if</span> <span class="o">(</span><span class="nx">t</span><span class="o">.</span><span class="nx">_isRegion</span><span class="o">)</span> <span class="o">{</span>
                    <span class="k">this</span><span class="o">.</span><span class="nx">_setRegionValue</span><span class="o">(</span><span class="nx">Slider</span><span class="o">.</span><span class="nx">SOURCE_KEY_EVENT</span><span class="o">,</span> <span class="nx">h</span><span class="o">,</span> <span class="nx">v</span><span class="o">,</span> <span class="kc">true</span><span class="o">);</span>
                <span class="o">}</span> <span class="k">else</span> <span class="o">{</span>
                    <span class="k">this</span><span class="o">.</span><span class="nx">_setValue</span><span class="o">(</span><span class="nx">Slider</span><span class="o">.</span><span class="nx">SOURCE_KEY_EVENT</span><span class="o">,</span>
                        <span class="o">(</span><span class="nx">t</span><span class="o">.</span><span class="nx">_isHoriz</span> <span class="o">?</span> <span class="nx">h</span> <span class="o">:</span> <span class="nx">v</span><span class="o">),</span> <span class="kc">true</span><span class="o">);</span>
                <span class="o">}</span>
                <span class="nx">Event</span><span class="o">.</span><span class="nx">stopEvent</span><span class="o">(</span><span class="nx">e</span><span class="o">);</span>
            <span class="o">}</span>

        <span class="o">}</span>
    <span class="o">},</span>

    <span class="c">/**</span>
<span class="c">     * Initialization that sets up the value offsets once the elements are ready</span>
<span class="c">     * @method setStartSliderState</span>
<span class="c">     */</span>
    <span class="nx">setStartSliderState</span><span class="o">:</span> <span class="k">function</span><span class="o">()</span> <span class="o">{</span>

        <span class="k">this</span><span class="o">.</span><span class="nx">logger</span><span class="o">.</span><span class="nx">log</span><span class="o">(</span><span class="s2">&quot;Fixing state&quot;</span><span class="o">);</span>

        <span class="k">this</span><span class="o">.</span><span class="nx">setThumbCenterPoint</span><span class="o">();</span>

        <span class="c">/**</span>
<span class="c">         * The basline position of the background element, used</span>
<span class="c">         * to determine if the background has moved since the last</span>
<span class="c">         * operation.</span>
<span class="c">         * @property baselinePos</span>
<span class="c">         * @type [int, int]</span>
<span class="c">         */</span>
        <span class="k">this</span><span class="o">.</span><span class="nx">baselinePos</span> <span class="o">=</span> <span class="nx">getXY</span><span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">getEl</span><span class="o">());</span>

        <span class="k">this</span><span class="o">.</span><span class="nx">thumb</span><span class="o">.</span><span class="nx">startOffset</span> <span class="o">=</span> <span class="k">this</span><span class="o">.</span><span class="nx">thumb</span><span class="o">.</span><span class="nx">getOffsetFromParent</span><span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">baselinePos</span><span class="o">);</span>

        <span class="k">if</span> <span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">thumb</span><span class="o">.</span><span class="nx">_isRegion</span><span class="o">)</span> <span class="o">{</span>
            <span class="k">if</span> <span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">deferredSetRegionValue</span><span class="o">)</span> <span class="o">{</span>
                <span class="k">this</span><span class="o">.</span><span class="nx">_setRegionValue</span><span class="o">.</span><span class="nx">apply</span><span class="o">(</span><span class="k">this</span><span class="o">,</span> <span class="k">this</span><span class="o">.</span><span class="nx">deferredSetRegionValue</span><span class="o">);</span>
                <span class="k">this</span><span class="o">.</span><span class="nx">deferredSetRegionValue</span> <span class="o">=</span> <span class="kc">null</span><span class="o">;</span>
            <span class="o">}</span> <span class="k">else</span> <span class="o">{</span>
                <span class="k">this</span><span class="o">.</span><span class="nx">setRegionValue</span><span class="o">(</span><span class="m">0</span><span class="o">,</span> <span class="m">0</span><span class="o">,</span> <span class="kc">true</span><span class="o">,</span> <span class="kc">true</span><span class="o">,</span> <span class="kc">true</span><span class="o">);</span>
            <span class="o">}</span>
        <span class="o">}</span> <span class="k">else</span> <span class="o">{</span>
            <span class="k">if</span> <span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">deferredSetValue</span><span class="o">)</span> <span class="o">{</span>
                <span class="k">this</span><span class="o">.</span><span class="nx">_setValue</span><span class="o">.</span><span class="nx">apply</span><span class="o">(</span><span class="k">this</span><span class="o">,</span> <span class="k">this</span><span class="o">.</span><span class="nx">deferredSetValue</span><span class="o">);</span>
                <span class="k">this</span><span class="o">.</span><span class="nx">deferredSetValue</span> <span class="o">=</span> <span class="kc">null</span><span class="o">;</span>
            <span class="o">}</span> <span class="k">else</span> <span class="o">{</span>
                <span class="k">this</span><span class="o">.</span><span class="nx">setValue</span><span class="o">(</span><span class="m">0</span><span class="o">,</span> <span class="kc">true</span><span class="o">,</span> <span class="kc">true</span><span class="o">,</span> <span class="kc">true</span><span class="o">);</span>
            <span class="o">}</span>
        <span class="o">}</span>
    <span class="o">},</span>

    <span class="c">/**</span>
<span class="c">     * When the thumb is available, we cache the centerpoint of the element so</span>
<span class="c">     * we can position the element correctly when the background is clicked</span>
<span class="c">     * @method setThumbCenterPoint</span>
<span class="c">     */</span>
    <span class="nx">setThumbCenterPoint</span><span class="o">:</span> <span class="k">function</span><span class="o">()</span> <span class="o">{</span>

        <span class="k">var</span> <span class="nx">el</span> <span class="o">=</span> <span class="k">this</span><span class="o">.</span><span class="nx">thumb</span><span class="o">.</span><span class="nx">getEl</span><span class="o">();</span>

        <span class="k">if</span> <span class="o">(</span><span class="nx">el</span><span class="o">)</span> <span class="o">{</span>
            <span class="c">/**</span>
<span class="c">             * The center of the slider element is stored so we can </span>
<span class="c">             * place it in the correct position when the background is clicked.</span>
<span class="c">             * @property thumbCenterPoint</span>
<span class="c">             * @type {&quot;x&quot;: int, &quot;y&quot;: int}</span>
<span class="c">             */</span>
            <span class="k">this</span><span class="o">.</span><span class="nx">thumbCenterPoint</span> <span class="o">=</span> <span class="o">{</span> 
                    <span class="nx">x</span><span class="o">:</span> <span class="nb">parseInt</span><span class="o">(</span><span class="nx">el</span><span class="o">.</span><span class="nx">offsetWidth</span><span class="o">/</span><span class="m">2</span><span class="o">,</span> <span class="m">10</span><span class="o">),</span> 
                    <span class="nx">y</span><span class="o">:</span> <span class="nb">parseInt</span><span class="o">(</span><span class="nx">el</span><span class="o">.</span><span class="nx">offsetHeight</span><span class="o">/</span><span class="m">2</span><span class="o">,</span> <span class="m">10</span><span class="o">)</span> 
            <span class="o">};</span>
        <span class="o">}</span>

    <span class="o">},</span>

    <span class="c">/**</span>
<span class="c">     * Locks the slider, overrides YAHOO.util.DragDrop</span>
<span class="c">     * @method lock</span>
<span class="c">     */</span>
    <span class="nx">lock</span><span class="o">:</span> <span class="k">function</span><span class="o">()</span> <span class="o">{</span>
        <span class="k">this</span><span class="o">.</span><span class="nx">logger</span><span class="o">.</span><span class="nx">log</span><span class="o">(</span><span class="s2">&quot;locking&quot;</span><span class="o">);</span>
        <span class="k">this</span><span class="o">.</span><span class="nx">thumb</span><span class="o">.</span><span class="nx">lock</span><span class="o">();</span>
        <span class="k">this</span><span class="o">.</span><span class="nx">locked</span> <span class="o">=</span> <span class="kc">true</span><span class="o">;</span>
    <span class="o">},</span>

    <span class="c">/**</span>
<span class="c">     * Unlocks the slider, overrides YAHOO.util.DragDrop</span>
<span class="c">     * @method unlock</span>
<span class="c">     */</span>
    <span class="nx">unlock</span><span class="o">:</span> <span class="k">function</span><span class="o">()</span> <span class="o">{</span>
        <span class="k">this</span><span class="o">.</span><span class="nx">logger</span><span class="o">.</span><span class="nx">log</span><span class="o">(</span><span class="s2">&quot;unlocking&quot;</span><span class="o">);</span>
        <span class="k">this</span><span class="o">.</span><span class="nx">thumb</span><span class="o">.</span><span class="nx">unlock</span><span class="o">();</span>
        <span class="k">this</span><span class="o">.</span><span class="nx">locked</span> <span class="o">=</span> <span class="kc">false</span><span class="o">;</span>
    <span class="o">},</span>

    <span class="c">/**</span>
<span class="c">     * Handles mouseup event on the thumb</span>
<span class="c">     * @method thumbMouseUp</span>
<span class="c">     * @private</span>
<span class="c">     */</span>
    <span class="nx">thumbMouseUp</span><span class="o">:</span> <span class="k">function</span><span class="o">()</span> <span class="o">{</span>
        <span class="k">this</span><span class="o">.</span><span class="nx">_mouseDown</span> <span class="o">=</span> <span class="kc">false</span><span class="o">;</span>
        <span class="k">this</span><span class="o">.</span><span class="nx">logger</span><span class="o">.</span><span class="nx">log</span><span class="o">(</span><span class="s2">&quot;thumb mouseup&quot;</span><span class="o">);</span>
        <span class="k">if</span> <span class="o">(!</span><span class="k">this</span><span class="o">.</span><span class="nx">isLocked</span><span class="o">()</span> <span class="o">&amp;&amp;</span> <span class="o">!</span><span class="k">this</span><span class="o">.</span><span class="nx">moveComplete</span><span class="o">)</span> <span class="o">{</span>
            <span class="k">this</span><span class="o">.</span><span class="nx">endMove</span><span class="o">();</span>
        <span class="o">}</span>

    <span class="o">},</span>

    <span class="nx">onMouseUp</span><span class="o">:</span> <span class="k">function</span><span class="o">()</span> <span class="o">{</span>
        <span class="k">this</span><span class="o">.</span><span class="nx">_mouseDown</span> <span class="o">=</span> <span class="kc">false</span><span class="o">;</span>
        <span class="k">this</span><span class="o">.</span><span class="nx">logger</span><span class="o">.</span><span class="nx">log</span><span class="o">(</span><span class="s2">&quot;background mouseup&quot;</span><span class="o">);</span>
        <span class="k">if</span> <span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">backgroundEnabled</span> <span class="o">&amp;&amp;</span> <span class="o">!</span><span class="k">this</span><span class="o">.</span><span class="nx">isLocked</span><span class="o">()</span> <span class="o">&amp;&amp;</span> <span class="o">!</span><span class="k">this</span><span class="o">.</span><span class="nx">moveComplete</span><span class="o">)</span> <span class="o">{</span>
            <span class="k">this</span><span class="o">.</span><span class="nx">endMove</span><span class="o">();</span>
        <span class="o">}</span>
    <span class="o">},</span>

    <span class="c">/**</span>
<span class="c">     * Returns a reference to this slider&#39;s thumb</span>
<span class="c">     * @method getThumb</span>
<span class="c">     * @return {SliderThumb} this slider&#39;s thumb</span>
<span class="c">     */</span>
    <span class="nx">getThumb</span><span class="o">:</span> <span class="k">function</span><span class="o">()</span> <span class="o">{</span>
        <span class="k">return</span> <span class="k">this</span><span class="o">.</span><span class="nx">thumb</span><span class="o">;</span>
    <span class="o">},</span>

    <span class="c">/**</span>
<span class="c">     * Try to focus the element when clicked so we can add</span>
<span class="c">     * accessibility features</span>
<span class="c">     * @method focus</span>
<span class="c">     * @private</span>
<span class="c">     */</span>
    <span class="nx">focus</span><span class="o">:</span> <span class="k">function</span><span class="o">()</span> <span class="o">{</span>
        <span class="k">this</span><span class="o">.</span><span class="nx">logger</span><span class="o">.</span><span class="nx">log</span><span class="o">(</span><span class="s2">&quot;focus&quot;</span><span class="o">);</span>
        <span class="k">this</span><span class="o">.</span><span class="nx">valueChangeSource</span> <span class="o">=</span> <span class="nx">Slider</span><span class="o">.</span><span class="nx">SOURCE_UI_EVENT</span><span class="o">;</span>

        <span class="c">// Focus the background element if possible</span>
<span class="c"></span>        <span class="k">var</span> <span class="nx">el</span> <span class="o">=</span> <span class="k">this</span><span class="o">.</span><span class="nx">getEl</span><span class="o">();</span>

        <span class="k">if</span> <span class="o">(</span><span class="nx">el</span><span class="o">.</span><span class="nx">focus</span><span class="o">)</span> <span class="o">{</span>
            <span class="k">try</span> <span class="o">{</span>
                <span class="nx">el</span><span class="o">.</span><span class="nx">focus</span><span class="o">();</span>
            <span class="o">}</span> <span class="k">catch</span><span class="o">(</span><span class="nx">e</span><span class="o">)</span> <span class="o">{</span>
                <span class="c">// Prevent permission denied unhandled exception in FF that can</span>
<span class="c"></span>                <span class="c">// happen when setting focus while another element is handling</span>
<span class="c"></span>                <span class="c">// the blur.  @TODO this is still writing to the error log </span>
<span class="c"></span>                <span class="c">// (unhandled error) in FF1.5 with strict error checking on.</span>
<span class="c"></span>            <span class="o">}</span>
        <span class="o">}</span>

        <span class="k">this</span><span class="o">.</span><span class="nx">verifyOffset</span><span class="o">();</span>

        <span class="k">return</span> <span class="o">!</span><span class="k">this</span><span class="o">.</span><span class="nx">isLocked</span><span class="o">();</span>
    <span class="o">},</span>

    <span class="c">/**</span>
<span class="c">     * Event that fires when the value of the slider has changed</span>
<span class="c">     * @method onChange</span>
<span class="c">     * @param {int} firstOffset the number of pixels the thumb has moved</span>
<span class="c">     * from its start position. Normal horizontal and vertical sliders will only</span>
<span class="c">     * have the firstOffset.  Regions will have both, the first is the horizontal</span>
<span class="c">     * offset, the second the vertical.</span>
<span class="c">     * @param {int} secondOffset the y offset for region sliders</span>
<span class="c">     * @deprecated use instance.subscribe(&quot;change&quot;) instead</span>
<span class="c">     */</span>
    <span class="nx">onChange</span><span class="o">:</span> <span class="k">function</span> <span class="o">(</span><span class="nx">firstOffset</span><span class="o">,</span> <span class="nx">secondOffset</span><span class="o">)</span> <span class="o">{</span> 
        <span class="c">/* override me */</span> 
        <span class="k">this</span><span class="o">.</span><span class="nx">logger</span><span class="o">.</span><span class="nx">log</span><span class="o">(</span><span class="s2">&quot;onChange: &quot;</span> <span class="o">+</span> <span class="nx">firstOffset</span> <span class="o">+</span> <span class="s2">&quot;, &quot;</span> <span class="o">+</span> <span class="nx">secondOffset</span><span class="o">);</span>
    <span class="o">},</span>

    <span class="c">/**</span>
<span class="c">     * Event that fires when the at the beginning of the slider thumb move</span>
<span class="c">     * @method onSlideStart</span>
<span class="c">     * @deprecated use instance.subscribe(&quot;slideStart&quot;) instead</span>
<span class="c">     */</span>
    <span class="nx">onSlideStart</span><span class="o">:</span> <span class="k">function</span> <span class="o">()</span> <span class="o">{</span> 
        <span class="c">/* override me */</span> 
        <span class="k">this</span><span class="o">.</span><span class="nx">logger</span><span class="o">.</span><span class="nx">log</span><span class="o">(</span><span class="s2">&quot;onSlideStart&quot;</span><span class="o">);</span>
    <span class="o">},</span>

    <span class="c">/**</span>
<span class="c">     * Event that fires at the end of a slider thumb move</span>
<span class="c">     * @method onSliderEnd</span>
<span class="c">     * @deprecated use instance.subscribe(&quot;slideEnd&quot;) instead</span>
<span class="c">     */</span>
    <span class="nx">onSlideEnd</span><span class="o">:</span> <span class="k">function</span> <span class="o">()</span> <span class="o">{</span> 
        <span class="c">/* override me */</span> 
        <span class="k">this</span><span class="o">.</span><span class="nx">logger</span><span class="o">.</span><span class="nx">log</span><span class="o">(</span><span class="s2">&quot;onSlideEnd&quot;</span><span class="o">);</span>
    <span class="o">},</span>

    <span class="c">/**</span>
<span class="c">     * Returns the slider&#39;s thumb offset from the start position</span>
<span class="c">     * @method getValue</span>
<span class="c">     * @return {int} the current value</span>
<span class="c">     */</span>
    <span class="nx">getValue</span><span class="o">:</span> <span class="k">function</span> <span class="o">()</span> <span class="o">{</span> 
        <span class="k">return</span> <span class="k">this</span><span class="o">.</span><span class="nx">thumb</span><span class="o">.</span><span class="nx">getValue</span><span class="o">();</span>
    <span class="o">},</span>

    <span class="c">/**</span>
<span class="c">     * Returns the slider&#39;s thumb X offset from the start position</span>
<span class="c">     * @method getXValue</span>
<span class="c">     * @return {int} the current horizontal offset</span>
<span class="c">     */</span>
    <span class="nx">getXValue</span><span class="o">:</span> <span class="k">function</span> <span class="o">()</span> <span class="o">{</span> 
        <span class="k">return</span> <span class="k">this</span><span class="o">.</span><span class="nx">thumb</span><span class="o">.</span><span class="nx">getXValue</span><span class="o">();</span>
    <span class="o">},</span>

    <span class="c">/**</span>
<span class="c">     * Returns the slider&#39;s thumb Y offset from the start position</span>
<span class="c">     * @method getYValue</span>
<span class="c">     * @return {int} the current vertical offset</span>
<span class="c">     */</span>
    <span class="nx">getYValue</span><span class="o">:</span> <span class="k">function</span> <span class="o">()</span> <span class="o">{</span> 
        <span class="k">return</span> <span class="k">this</span><span class="o">.</span><span class="nx">thumb</span><span class="o">.</span><span class="nx">getYValue</span><span class="o">();</span>
    <span class="o">},</span>

    <span class="c">/**</span>
<span class="c">     * Provides a way to set the value of the slider in code.</span>
<span class="c">     *</span>
<span class="c">     * @method setValue</span>
<span class="c">     * @param {int} newOffset the number of pixels the thumb should be</span>
<span class="c">     * positioned away from the initial start point </span>
<span class="c">     * @param {boolean} skipAnim set to true to disable the animation</span>
<span class="c">     * for this move action (but not others).</span>
<span class="c">     * @param {boolean} force ignore the locked setting and set value anyway</span>
<span class="c">     * @param {boolean} silent when true, do not fire events</span>
<span class="c">     * @return {boolean} true if the move was performed, false if it failed</span>
<span class="c">     */</span>
    <span class="nx">setValue</span><span class="o">:</span> <span class="k">function</span><span class="o">()</span> <span class="o">{</span>
        <span class="k">var</span> <span class="nx">args</span> <span class="o">=</span> <span class="nx">_AS</span><span class="o">.</span><span class="nx">call</span><span class="o">(</span><span class="nx">arguments</span><span class="o">);</span>
        <span class="nx">args</span><span class="o">.</span><span class="nx">unshift</span><span class="o">(</span><span class="nx">Slider</span><span class="o">.</span><span class="nx">SOURCE_SET_VALUE</span><span class="o">);</span>
        <span class="k">return</span> <span class="k">this</span><span class="o">.</span><span class="nx">_setValue</span><span class="o">.</span><span class="nx">apply</span><span class="o">(</span><span class="k">this</span><span class="o">,</span><span class="nx">args</span><span class="o">);</span>
    <span class="o">},</span>

    <span class="c">/**</span>
<span class="c">     * Worker function to execute the value set operation.  Accepts type of</span>
<span class="c">     * set operation in addition to the usual setValue params.</span>
<span class="c">     *</span>
<span class="c">     * @method _setValue</span>
<span class="c">     * @param source {int} what triggered the set (e.g. Slider.SOURCE_SET_VALUE)</span>
<span class="c">     * @param {int} newOffset the number of pixels the thumb should be</span>
<span class="c">     * positioned away from the initial start point </span>
<span class="c">     * @param {boolean} skipAnim set to true to disable the animation</span>
<span class="c">     * for this move action (but not others).</span>
<span class="c">     * @param {boolean} force ignore the locked setting and set value anyway</span>
<span class="c">     * @param {boolean} silent when true, do not fire events</span>
<span class="c">     * @return {boolean} true if the move was performed, false if it failed</span>
<span class="c">     * @protected</span>
<span class="c">     */</span>
    <span class="nx">_setValue</span><span class="o">:</span> <span class="k">function</span><span class="o">(</span><span class="nx">source</span><span class="o">,</span> <span class="nx">newOffset</span><span class="o">,</span> <span class="nx">skipAnim</span><span class="o">,</span> <span class="nx">force</span><span class="o">,</span> <span class="nx">silent</span><span class="o">)</span> <span class="o">{</span>
        <span class="k">var</span> <span class="nx">t</span> <span class="o">=</span> <span class="k">this</span><span class="o">.</span><span class="nx">thumb</span><span class="o">,</span> <span class="nx">newX</span><span class="o">,</span> <span class="nx">newY</span><span class="o">;</span>

        <span class="k">if</span> <span class="o">(!</span><span class="nx">t</span><span class="o">.</span><span class="nx">available</span><span class="o">)</span> <span class="o">{</span>
            <span class="k">this</span><span class="o">.</span><span class="nx">logger</span><span class="o">.</span><span class="nx">log</span><span class="o">(</span><span class="s2">&quot;defer setValue until after onAvailble&quot;</span><span class="o">);</span>
            <span class="k">this</span><span class="o">.</span><span class="nx">deferredSetValue</span> <span class="o">=</span> <span class="nx">arguments</span><span class="o">;</span>
            <span class="k">return</span> <span class="kc">false</span><span class="o">;</span>
        <span class="o">}</span>

        <span class="k">if</span> <span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">isLocked</span><span class="o">()</span> <span class="o">&amp;&amp;</span> <span class="o">!</span><span class="nx">force</span><span class="o">)</span> <span class="o">{</span>
            <span class="k">this</span><span class="o">.</span><span class="nx">logger</span><span class="o">.</span><span class="nx">log</span><span class="o">(</span><span class="s2">&quot;Can&#39;t set the value, the control is locked&quot;</span><span class="o">);</span>
            <span class="k">return</span> <span class="kc">false</span><span class="o">;</span>
        <span class="o">}</span>

        <span class="k">if</span> <span class="o">(</span> <span class="nb">isNaN</span><span class="o">(</span><span class="nx">newOffset</span><span class="o">)</span> <span class="o">)</span> <span class="o">{</span>
            <span class="k">this</span><span class="o">.</span><span class="nx">logger</span><span class="o">.</span><span class="nx">log</span><span class="o">(</span><span class="s2">&quot;setValue, Illegal argument: &quot;</span> <span class="o">+</span> <span class="nx">newOffset</span><span class="o">);</span>
            <span class="k">return</span> <span class="kc">false</span><span class="o">;</span>
        <span class="o">}</span>

        <span class="k">if</span> <span class="o">(</span><span class="nx">t</span><span class="o">.</span><span class="nx">_isRegion</span><span class="o">)</span> <span class="o">{</span>
            <span class="k">this</span><span class="o">.</span><span class="nx">logger</span><span class="o">.</span><span class="nx">log</span><span class="o">(</span><span class="s2">&quot;Call to setValue for region Slider ignored. Use setRegionValue&quot;</span><span class="o">,</span><span class="s2">&quot;warn&quot;</span><span class="o">);</span>
            <span class="k">return</span> <span class="kc">false</span><span class="o">;</span>
        <span class="o">}</span>

        <span class="k">this</span><span class="o">.</span><span class="nx">logger</span><span class="o">.</span><span class="nx">log</span><span class="o">(</span><span class="s2">&quot;setValue &quot;</span> <span class="o">+</span> <span class="nx">newOffset</span><span class="o">);</span>

        <span class="k">this</span><span class="o">.</span><span class="nx">_silent</span> <span class="o">=</span> <span class="nx">silent</span><span class="o">;</span>
        <span class="k">this</span><span class="o">.</span><span class="nx">valueChangeSource</span> <span class="o">=</span> <span class="nx">source</span> <span class="o">||</span> <span class="nx">Slider</span><span class="o">.</span><span class="nx">SOURCE_SET_VALUE</span><span class="o">;</span>

        <span class="nx">t</span><span class="o">.</span><span class="nx">lastOffset</span> <span class="o">=</span> <span class="o">[</span><span class="nx">newOffset</span><span class="o">,</span> <span class="nx">newOffset</span><span class="o">];</span>
        <span class="k">this</span><span class="o">.</span><span class="nx">verifyOffset</span><span class="o">(</span><span class="kc">true</span><span class="o">);</span>

        <span class="k">this</span><span class="o">.</span><span class="nx">_slideStart</span><span class="o">();</span>

        <span class="k">if</span> <span class="o">(</span><span class="nx">t</span><span class="o">.</span><span class="nx">_isHoriz</span><span class="o">)</span> <span class="o">{</span>
            <span class="nx">newX</span> <span class="o">=</span> <span class="nx">t</span><span class="o">.</span><span class="nx">initPageX</span> <span class="o">+</span> <span class="nx">newOffset</span> <span class="o">+</span> <span class="k">this</span><span class="o">.</span><span class="nx">thumbCenterPoint</span><span class="o">.</span><span class="nx">x</span><span class="o">;</span>
            <span class="k">this</span><span class="o">.</span><span class="nx">moveThumb</span><span class="o">(</span><span class="nx">newX</span><span class="o">,</span> <span class="nx">t</span><span class="o">.</span><span class="nx">initPageY</span><span class="o">,</span> <span class="nx">skipAnim</span><span class="o">);</span>
        <span class="o">}</span> <span class="k">else</span> <span class="o">{</span>
            <span class="nx">newY</span> <span class="o">=</span> <span class="nx">t</span><span class="o">.</span><span class="nx">initPageY</span> <span class="o">+</span> <span class="nx">newOffset</span> <span class="o">+</span> <span class="k">this</span><span class="o">.</span><span class="nx">thumbCenterPoint</span><span class="o">.</span><span class="nx">y</span><span class="o">;</span>
            <span class="k">this</span><span class="o">.</span><span class="nx">moveThumb</span><span class="o">(</span><span class="nx">t</span><span class="o">.</span><span class="nx">initPageX</span><span class="o">,</span> <span class="nx">newY</span><span class="o">,</span> <span class="nx">skipAnim</span><span class="o">);</span>
        <span class="o">}</span>

        <span class="k">return</span> <span class="kc">true</span><span class="o">;</span>
    <span class="o">},</span>

    <span class="c">/**</span>
<span class="c">     * Provides a way to set the value of the region slider in code.</span>
<span class="c">     * @method setRegionValue</span>
<span class="c">     * @param {int} newOffset the number of pixels the thumb should be</span>
<span class="c">     * positioned away from the initial start point (x axis for region)</span>
<span class="c">     * @param {int} newOffset2 the number of pixels the thumb should be</span>
<span class="c">     * positioned away from the initial start point (y axis for region)</span>
<span class="c">     * @param {boolean} skipAnim set to true to disable the animation</span>
<span class="c">     * for this move action (but not others).</span>
<span class="c">     * @param {boolean} force ignore the locked setting and set value anyway</span>
<span class="c">     * @param {boolean} silent when true, do not fire events</span>
<span class="c">     * @return {boolean} true if the move was performed, false if it failed</span>
<span class="c">     */</span>
    <span class="nx">setRegionValue</span> <span class="o">:</span> <span class="k">function</span> <span class="o">()</span> <span class="o">{</span>
        <span class="k">var</span> <span class="nx">args</span> <span class="o">=</span> <span class="nx">_AS</span><span class="o">.</span><span class="nx">call</span><span class="o">(</span><span class="nx">arguments</span><span class="o">);</span>
        <span class="nx">args</span><span class="o">.</span><span class="nx">unshift</span><span class="o">(</span><span class="nx">Slider</span><span class="o">.</span><span class="nx">SOURCE_SET_VALUE</span><span class="o">);</span>
        <span class="k">return</span> <span class="k">this</span><span class="o">.</span><span class="nx">_setRegionValue</span><span class="o">.</span><span class="nx">apply</span><span class="o">(</span><span class="k">this</span><span class="o">,</span><span class="nx">args</span><span class="o">);</span>
    <span class="o">},</span>

    <span class="c">/**</span>
<span class="c">     * Worker function to execute the value set operation.  Accepts type of</span>
<span class="c">     * set operation in addition to the usual setValue params.</span>
<span class="c">     *</span>
<span class="c">     * @method _setRegionValue</span>
<span class="c">     * @param source {int} what triggered the set (e.g. Slider.SOURCE_SET_VALUE)</span>
<span class="c">     * @param {int} newOffset the number of pixels the thumb should be</span>
<span class="c">     * positioned away from the initial start point (x axis for region)</span>
<span class="c">     * @param {int} newOffset2 the number of pixels the thumb should be</span>
<span class="c">     * positioned away from the initial start point (y axis for region)</span>
<span class="c">     * @param {boolean} skipAnim set to true to disable the animation</span>
<span class="c">     * for this move action (but not others).</span>
<span class="c">     * @param {boolean} force ignore the locked setting and set value anyway</span>
<span class="c">     * @param {boolean} silent when true, do not fire events</span>
<span class="c">     * @return {boolean} true if the move was performed, false if it failed</span>
<span class="c">     * @protected</span>
<span class="c">     */</span>
    <span class="nx">_setRegionValue</span><span class="o">:</span> <span class="k">function</span><span class="o">(</span><span class="nx">source</span><span class="o">,</span> <span class="nx">newOffset</span><span class="o">,</span> <span class="nx">newOffset2</span><span class="o">,</span> <span class="nx">skipAnim</span><span class="o">,</span> <span class="nx">force</span><span class="o">,</span> <span class="nx">silent</span><span class="o">)</span> <span class="o">{</span>
        <span class="k">var</span> <span class="nx">t</span> <span class="o">=</span> <span class="k">this</span><span class="o">.</span><span class="nx">thumb</span><span class="o">,</span> <span class="nx">newX</span><span class="o">,</span> <span class="nx">newY</span><span class="o">;</span>

        <span class="k">if</span> <span class="o">(!</span><span class="nx">t</span><span class="o">.</span><span class="nx">available</span><span class="o">)</span> <span class="o">{</span>
            <span class="k">this</span><span class="o">.</span><span class="nx">logger</span><span class="o">.</span><span class="nx">log</span><span class="o">(</span><span class="s2">&quot;defer setRegionValue until after onAvailble&quot;</span><span class="o">);</span>
            <span class="k">this</span><span class="o">.</span><span class="nx">deferredSetRegionValue</span> <span class="o">=</span> <span class="nx">arguments</span><span class="o">;</span>
            <span class="k">return</span> <span class="kc">false</span><span class="o">;</span>
        <span class="o">}</span>

        <span class="k">if</span> <span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">isLocked</span><span class="o">()</span> <span class="o">&amp;&amp;</span> <span class="o">!</span><span class="nx">force</span><span class="o">)</span> <span class="o">{</span>
            <span class="k">this</span><span class="o">.</span><span class="nx">logger</span><span class="o">.</span><span class="nx">log</span><span class="o">(</span><span class="s2">&quot;Can&#39;t set the value, the control is locked&quot;</span><span class="o">);</span>
            <span class="k">return</span> <span class="kc">false</span><span class="o">;</span>
        <span class="o">}</span>

        <span class="k">if</span> <span class="o">(</span> <span class="nb">isNaN</span><span class="o">(</span><span class="nx">newOffset</span><span class="o">)</span> <span class="o">)</span> <span class="o">{</span>
            <span class="k">this</span><span class="o">.</span><span class="nx">logger</span><span class="o">.</span><span class="nx">log</span><span class="o">(</span><span class="s2">&quot;setRegionValue, Illegal argument: &quot;</span> <span class="o">+</span> <span class="nx">newOffset</span><span class="o">);</span>
            <span class="k">return</span> <span class="kc">false</span><span class="o">;</span>
        <span class="o">}</span>

        <span class="k">if</span> <span class="o">(!</span><span class="nx">t</span><span class="o">.</span><span class="nx">_isRegion</span><span class="o">)</span> <span class="o">{</span>
            <span class="k">this</span><span class="o">.</span><span class="nx">logger</span><span class="o">.</span><span class="nx">log</span><span class="o">(</span><span class="s2">&quot;Call to setRegionValue for non-region Slider ignored. Use setValue&quot;</span><span class="o">,</span><span class="s2">&quot;warn&quot;</span><span class="o">);</span>
            <span class="k">return</span> <span class="kc">false</span><span class="o">;</span>
        <span class="o">}</span>

        <span class="k">this</span><span class="o">.</span><span class="nx">_silent</span> <span class="o">=</span> <span class="nx">silent</span><span class="o">;</span>

        <span class="k">this</span><span class="o">.</span><span class="nx">valueChangeSource</span> <span class="o">=</span> <span class="nx">source</span> <span class="o">||</span> <span class="nx">Slider</span><span class="o">.</span><span class="nx">SOURCE_SET_VALUE</span><span class="o">;</span>

        <span class="nx">t</span><span class="o">.</span><span class="nx">lastOffset</span> <span class="o">=</span> <span class="o">[</span><span class="nx">newOffset</span><span class="o">,</span> <span class="nx">newOffset2</span><span class="o">];</span>
        <span class="k">this</span><span class="o">.</span><span class="nx">verifyOffset</span><span class="o">(</span><span class="kc">true</span><span class="o">);</span>

        <span class="k">this</span><span class="o">.</span><span class="nx">_slideStart</span><span class="o">();</span>

        <span class="nx">newX</span> <span class="o">=</span> <span class="nx">t</span><span class="o">.</span><span class="nx">initPageX</span> <span class="o">+</span> <span class="nx">newOffset</span> <span class="o">+</span> <span class="k">this</span><span class="o">.</span><span class="nx">thumbCenterPoint</span><span class="o">.</span><span class="nx">x</span><span class="o">;</span>
        <span class="nx">newY</span> <span class="o">=</span> <span class="nx">t</span><span class="o">.</span><span class="nx">initPageY</span> <span class="o">+</span> <span class="nx">newOffset2</span> <span class="o">+</span> <span class="k">this</span><span class="o">.</span><span class="nx">thumbCenterPoint</span><span class="o">.</span><span class="nx">y</span><span class="o">;</span>
        <span class="k">this</span><span class="o">.</span><span class="nx">moveThumb</span><span class="o">(</span><span class="nx">newX</span><span class="o">,</span> <span class="nx">newY</span><span class="o">,</span> <span class="nx">skipAnim</span><span class="o">);</span>

        <span class="k">return</span> <span class="kc">true</span><span class="o">;</span>
    <span class="o">},</span>

    <span class="c">/**</span>
<span class="c">     * Checks the background position element position.  If it has moved from the</span>
<span class="c">     * baseline position, the constraints for the thumb are reset</span>
<span class="c">     * @param checkPos {boolean} check the position instead of using cached value</span>
<span class="c">     * @method verifyOffset</span>
<span class="c">     * @return {boolean} True if the offset is the same as the baseline.</span>
<span class="c">     */</span>
    <span class="nx">verifyOffset</span><span class="o">:</span> <span class="k">function</span><span class="o">(</span><span class="nx">checkPos</span><span class="o">)</span> <span class="o">{</span>

        <span class="k">var</span> <span class="nx">xy</span> <span class="o">=</span> <span class="nx">getXY</span><span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">getEl</span><span class="o">()),</span>
            <span class="nx">t</span>  <span class="o">=</span> <span class="k">this</span><span class="o">.</span><span class="nx">thumb</span><span class="o">;</span>

        <span class="k">if</span> <span class="o">(!</span><span class="k">this</span><span class="o">.</span><span class="nx">thumbCenterPoint</span> <span class="o">||</span> <span class="o">!</span><span class="k">this</span><span class="o">.</span><span class="nx">thumbCenterPoint</span><span class="o">.</span><span class="nx">x</span><span class="o">)</span> <span class="o">{</span>
            <span class="k">this</span><span class="o">.</span><span class="nx">setThumbCenterPoint</span><span class="o">();</span>
        <span class="o">}</span>

        <span class="k">if</span> <span class="o">(</span><span class="nx">xy</span><span class="o">)</span> <span class="o">{</span>

            <span class="k">this</span><span class="o">.</span><span class="nx">logger</span><span class="o">.</span><span class="nx">log</span><span class="o">(</span><span class="s2">&quot;newPos: &quot;</span> <span class="o">+</span> <span class="nx">xy</span><span class="o">);</span>

            <span class="k">if</span> <span class="o">(</span><span class="nx">xy</span><span class="o">[</span><span class="m">0</span><span class="o">]</span> <span class="o">!=</span> <span class="k">this</span><span class="o">.</span><span class="nx">baselinePos</span><span class="o">[</span><span class="m">0</span><span class="o">]</span> <span class="o">||</span> <span class="nx">xy</span><span class="o">[</span><span class="m">1</span><span class="o">]</span> <span class="o">!=</span> <span class="k">this</span><span class="o">.</span><span class="nx">baselinePos</span><span class="o">[</span><span class="m">1</span><span class="o">])</span> <span class="o">{</span>
                <span class="k">this</span><span class="o">.</span><span class="nx">logger</span><span class="o">.</span><span class="nx">log</span><span class="o">(</span><span class="s2">&quot;background moved, resetting constraints&quot;</span><span class="o">);</span>

                <span class="c">// Reset background</span>
<span class="c"></span>                <span class="k">this</span><span class="o">.</span><span class="nx">setInitPosition</span><span class="o">();</span>
                <span class="k">this</span><span class="o">.</span><span class="nx">baselinePos</span> <span class="o">=</span> <span class="nx">xy</span><span class="o">;</span>

                <span class="c">// Reset thumb</span>
<span class="c"></span>                <span class="nx">t</span><span class="o">.</span><span class="nx">initPageX</span> <span class="o">=</span> <span class="k">this</span><span class="o">.</span><span class="nx">initPageX</span> <span class="o">+</span> <span class="nx">t</span><span class="o">.</span><span class="nx">startOffset</span><span class="o">[</span><span class="m">0</span><span class="o">];</span>
                <span class="nx">t</span><span class="o">.</span><span class="nx">initPageY</span> <span class="o">=</span> <span class="k">this</span><span class="o">.</span><span class="nx">initPageY</span> <span class="o">+</span> <span class="nx">t</span><span class="o">.</span><span class="nx">startOffset</span><span class="o">[</span><span class="m">1</span><span class="o">];</span>
                <span class="nx">t</span><span class="o">.</span><span class="nx">deltaSetXY</span> <span class="o">=</span> <span class="kc">null</span><span class="o">;</span>
                <span class="k">this</span><span class="o">.</span><span class="nx">resetThumbConstraints</span><span class="o">();</span>

                <span class="k">return</span> <span class="kc">false</span><span class="o">;</span>
            <span class="o">}</span>
        <span class="o">}</span>

        <span class="k">return</span> <span class="kc">true</span><span class="o">;</span>
    <span class="o">},</span>

    <span class="c">/**</span>
<span class="c">     * Move the associated slider moved to a timeout to try to get around the </span>
<span class="c">     * mousedown stealing moz does when I move the slider element between the </span>
<span class="c">     * cursor and the background during the mouseup event</span>
<span class="c">     * @method moveThumb</span>
<span class="c">     * @param {int} x the X coordinate of the click</span>
<span class="c">     * @param {int} y the Y coordinate of the click</span>
<span class="c">     * @param {boolean} skipAnim don&#39;t animate if the move happend onDrag</span>
<span class="c">     * @param {boolean} midMove set to true if this is not terminating</span>
<span class="c">     * the slider movement</span>
<span class="c">     * @private</span>
<span class="c">     */</span>
    <span class="nx">moveThumb</span><span class="o">:</span> <span class="k">function</span><span class="o">(</span><span class="nx">x</span><span class="o">,</span> <span class="nx">y</span><span class="o">,</span> <span class="nx">skipAnim</span><span class="o">,</span> <span class="nx">midMove</span><span class="o">)</span> <span class="o">{</span>

        <span class="k">var</span> <span class="nx">t</span> <span class="o">=</span> <span class="k">this</span><span class="o">.</span><span class="nx">thumb</span><span class="o">,</span>
            <span class="nx">self</span> <span class="o">=</span> <span class="k">this</span><span class="o">,</span>
            <span class="nx">p</span><span class="o">,</span><span class="nx">_p</span><span class="o">,</span><span class="nx">anim</span><span class="o">;</span>

        <span class="k">if</span> <span class="o">(!</span><span class="nx">t</span><span class="o">.</span><span class="nx">available</span><span class="o">)</span> <span class="o">{</span>
            <span class="k">this</span><span class="o">.</span><span class="nx">logger</span><span class="o">.</span><span class="nx">log</span><span class="o">(</span><span class="s2">&quot;thumb is not available yet, aborting move&quot;</span><span class="o">);</span>
            <span class="k">return</span><span class="o">;</span>
        <span class="o">}</span>

        <span class="k">this</span><span class="o">.</span><span class="nx">logger</span><span class="o">.</span><span class="nx">log</span><span class="o">(</span><span class="s2">&quot;move thumb, x: &quot;</span>  <span class="o">+</span> <span class="nx">x</span> <span class="o">+</span> <span class="s2">&quot;, y: &quot;</span> <span class="o">+</span> <span class="nx">y</span><span class="o">);</span>

        <span class="nx">t</span><span class="o">.</span><span class="nx">setDelta</span><span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">thumbCenterPoint</span><span class="o">.</span><span class="nx">x</span><span class="o">,</span> <span class="k">this</span><span class="o">.</span><span class="nx">thumbCenterPoint</span><span class="o">.</span><span class="nx">y</span><span class="o">);</span>

        <span class="nx">_p</span> <span class="o">=</span> <span class="nx">t</span><span class="o">.</span><span class="nx">getTargetCoord</span><span class="o">(</span><span class="nx">x</span><span class="o">,</span> <span class="nx">y</span><span class="o">);</span>
        <span class="nx">p</span> <span class="o">=</span> <span class="o">[</span><span class="nb">Math</span><span class="o">.</span><span class="nx">round</span><span class="o">(</span><span class="nx">_p</span><span class="o">.</span><span class="nx">x</span><span class="o">),</span> <span class="nb">Math</span><span class="o">.</span><span class="nx">round</span><span class="o">(</span><span class="nx">_p</span><span class="o">.</span><span class="nx">y</span><span class="o">)];</span>

        <span class="k">if</span> <span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">animate</span> <span class="o">&amp;&amp;</span> <span class="nx">t</span><span class="o">.</span><span class="nx">_graduated</span> <span class="o">&amp;&amp;</span> <span class="o">!</span><span class="nx">skipAnim</span><span class="o">)</span> <span class="o">{</span>
            <span class="k">this</span><span class="o">.</span><span class="nx">logger</span><span class="o">.</span><span class="nx">log</span><span class="o">(</span><span class="s2">&quot;graduated&quot;</span><span class="o">);</span>
            <span class="k">this</span><span class="o">.</span><span class="nx">lock</span><span class="o">();</span>

            <span class="c">// cache the current thumb pos</span>
<span class="c"></span>            <span class="k">this</span><span class="o">.</span><span class="nx">curCoord</span> <span class="o">=</span> <span class="nx">getXY</span><span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">thumb</span><span class="o">.</span><span class="nx">getEl</span><span class="o">());</span>
            <span class="k">this</span><span class="o">.</span><span class="nx">curCoord</span> <span class="o">=</span> <span class="o">[</span><span class="nb">Math</span><span class="o">.</span><span class="nx">round</span><span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">curCoord</span><span class="o">[</span><span class="m">0</span><span class="o">]),</span> <span class="nb">Math</span><span class="o">.</span><span class="nx">round</span><span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">curCoord</span><span class="o">[</span><span class="m">1</span><span class="o">])];</span>

            <span class="nx">setTimeout</span><span class="o">(</span> <span class="k">function</span><span class="o">()</span> <span class="o">{</span> <span class="nx">self</span><span class="o">.</span><span class="nx">moveOneTick</span><span class="o">(</span><span class="nx">p</span><span class="o">);</span> <span class="o">},</span> <span class="k">this</span><span class="o">.</span><span class="nx">tickPause</span> <span class="o">);</span>

        <span class="o">}</span> <span class="k">else</span> <span class="k">if</span> <span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">animate</span> <span class="o">&amp;&amp;</span> <span class="nx">Slider</span><span class="o">.</span><span class="nx">ANIM_AVAIL</span> <span class="o">&amp;&amp;</span> <span class="o">!</span><span class="nx">skipAnim</span><span class="o">)</span> <span class="o">{</span>
            <span class="k">this</span><span class="o">.</span><span class="nx">logger</span><span class="o">.</span><span class="nx">log</span><span class="o">(</span><span class="s2">&quot;animating to &quot;</span> <span class="o">+</span> <span class="nx">p</span><span class="o">);</span>

            <span class="k">this</span><span class="o">.</span><span class="nx">lock</span><span class="o">();</span>

            <span class="nx">anim</span> <span class="o">=</span> <span class="k">new</span> <span class="nx">YAHOO</span><span class="o">.</span><span class="nx">util</span><span class="o">.</span><span class="nx">Motion</span><span class="o">(</span> 
                    <span class="nx">t</span><span class="o">.</span><span class="nx">id</span><span class="o">,</span> <span class="o">{</span> <span class="nx">points</span><span class="o">:</span> <span class="o">{</span> <span class="nx">to</span><span class="o">:</span> <span class="nx">p</span> <span class="o">}</span> <span class="o">},</span> 
                    <span class="k">this</span><span class="o">.</span><span class="nx">animationDuration</span><span class="o">,</span> 
                    <span class="nx">YAHOO</span><span class="o">.</span><span class="nx">util</span><span class="o">.</span><span class="nx">Easing</span><span class="o">.</span><span class="nx">easeOut</span> <span class="o">);</span>

            <span class="nx">anim</span><span class="o">.</span><span class="nx">onComplete</span><span class="o">.</span><span class="nx">subscribe</span><span class="o">(</span> <span class="k">function</span><span class="o">()</span> <span class="o">{</span> 
                    <span class="nx">self</span><span class="o">.</span><span class="nx">logger</span><span class="o">.</span><span class="nx">log</span><span class="o">(</span><span class="s2">&quot;Animation completed _mouseDown:&quot;</span> <span class="o">+</span> <span class="nx">self</span><span class="o">.</span><span class="nx">_mouseDown</span><span class="o">);</span>
                    <span class="nx">self</span><span class="o">.</span><span class="nx">unlock</span><span class="o">();</span>
                    <span class="k">if</span> <span class="o">(!</span><span class="nx">self</span><span class="o">.</span><span class="nx">_mouseDown</span><span class="o">)</span> <span class="o">{</span>
                        <span class="nx">self</span><span class="o">.</span><span class="nx">endMove</span><span class="o">();</span> 
                    <span class="o">}</span>
                <span class="o">});</span>
            <span class="nx">anim</span><span class="o">.</span><span class="nx">animate</span><span class="o">();</span>

        <span class="o">}</span> <span class="k">else</span> <span class="o">{</span>
            <span class="nx">t</span><span class="o">.</span><span class="nx">setDragElPos</span><span class="o">(</span><span class="nx">x</span><span class="o">,</span> <span class="nx">y</span><span class="o">);</span>
            <span class="k">if</span> <span class="o">(!</span><span class="nx">midMove</span> <span class="o">&amp;&amp;</span> <span class="o">!</span><span class="k">this</span><span class="o">.</span><span class="nx">_mouseDown</span><span class="o">)</span> <span class="o">{</span>
                <span class="k">this</span><span class="o">.</span><span class="nx">endMove</span><span class="o">();</span>
            <span class="o">}</span>
        <span class="o">}</span>
    <span class="o">},</span>

    <span class="nx">_slideStart</span><span class="o">:</span> <span class="k">function</span><span class="o">()</span> <span class="o">{</span>
        <span class="k">if</span> <span class="o">(!</span><span class="k">this</span><span class="o">.</span><span class="nx">_sliding</span><span class="o">)</span> <span class="o">{</span>
            <span class="k">if</span> <span class="o">(!</span><span class="k">this</span><span class="o">.</span><span class="nx">_silent</span><span class="o">)</span> <span class="o">{</span>
                <span class="k">this</span><span class="o">.</span><span class="nx">onSlideStart</span><span class="o">();</span>
                <span class="k">this</span><span class="o">.</span><span class="nx">fireEvent</span><span class="o">(</span><span class="s2">&quot;slideStart&quot;</span><span class="o">);</span>
            <span class="o">}</span>
            <span class="k">this</span><span class="o">.</span><span class="nx">_sliding</span> <span class="o">=</span> <span class="kc">true</span><span class="o">;</span>
        <span class="o">}</span>
    <span class="o">},</span>

    <span class="nx">_slideEnd</span><span class="o">:</span> <span class="k">function</span><span class="o">()</span> <span class="o">{</span>
        <span class="k">if</span> <span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">_sliding</span> <span class="o">&amp;&amp;</span> <span class="k">this</span><span class="o">.</span><span class="nx">moveComplete</span><span class="o">)</span> <span class="o">{</span>
            <span class="c">// Reset state before firing slideEnd</span>
<span class="c"></span>            <span class="k">var</span> <span class="nx">silent</span> <span class="o">=</span> <span class="k">this</span><span class="o">.</span><span class="nx">_silent</span><span class="o">;</span>
            <span class="k">this</span><span class="o">.</span><span class="nx">_sliding</span> <span class="o">=</span> <span class="kc">false</span><span class="o">;</span>
            <span class="k">this</span><span class="o">.</span><span class="nx">_silent</span> <span class="o">=</span> <span class="kc">false</span><span class="o">;</span>
            <span class="k">this</span><span class="o">.</span><span class="nx">moveComplete</span> <span class="o">=</span> <span class="kc">false</span><span class="o">;</span>
            <span class="k">if</span> <span class="o">(!</span><span class="nx">silent</span><span class="o">)</span> <span class="o">{</span>
                <span class="k">this</span><span class="o">.</span><span class="nx">onSlideEnd</span><span class="o">();</span>
                <span class="k">this</span><span class="o">.</span><span class="nx">fireEvent</span><span class="o">(</span><span class="s2">&quot;slideEnd&quot;</span><span class="o">);</span>
            <span class="o">}</span>
        <span class="o">}</span>
    <span class="o">},</span>

    <span class="c">/**</span>
<span class="c">     * Move the slider one tick mark towards its final coordinate.  Used</span>
<span class="c">     * for the animation when tick marks are defined</span>
<span class="c">     * @method moveOneTick</span>
<span class="c">     * @param {int[]} the destination coordinate</span>
<span class="c">     * @private</span>
<span class="c">     */</span>
    <span class="nx">moveOneTick</span><span class="o">:</span> <span class="k">function</span><span class="o">(</span><span class="nx">finalCoord</span><span class="o">)</span> <span class="o">{</span>

        <span class="k">var</span> <span class="nx">t</span> <span class="o">=</span> <span class="k">this</span><span class="o">.</span><span class="nx">thumb</span><span class="o">,</span>
            <span class="nx">self</span> <span class="o">=</span> <span class="k">this</span><span class="o">,</span>
            <span class="nx">nextCoord</span> <span class="o">=</span> <span class="kc">null</span><span class="o">,</span>
            <span class="nx">tmpX</span><span class="o">,</span> <span class="nx">tmpY</span><span class="o">;</span>

        <span class="k">if</span> <span class="o">(</span><span class="nx">t</span><span class="o">.</span><span class="nx">_isRegion</span><span class="o">)</span> <span class="o">{</span>
            <span class="nx">nextCoord</span> <span class="o">=</span> <span class="k">this</span><span class="o">.</span><span class="nx">_getNextX</span><span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">curCoord</span><span class="o">,</span> <span class="nx">finalCoord</span><span class="o">);</span>
            <span class="nx">tmpX</span> <span class="o">=</span> <span class="o">(</span><span class="nx">nextCoord</span> <span class="o">!==</span> <span class="kc">null</span><span class="o">)</span> <span class="o">?</span> <span class="nx">nextCoord</span><span class="o">[</span><span class="m">0</span><span class="o">]</span> <span class="o">:</span> <span class="k">this</span><span class="o">.</span><span class="nx">curCoord</span><span class="o">[</span><span class="m">0</span><span class="o">];</span>
            <span class="nx">nextCoord</span> <span class="o">=</span> <span class="k">this</span><span class="o">.</span><span class="nx">_getNextY</span><span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">curCoord</span><span class="o">,</span> <span class="nx">finalCoord</span><span class="o">);</span>
            <span class="nx">tmpY</span> <span class="o">=</span> <span class="o">(</span><span class="nx">nextCoord</span> <span class="o">!==</span> <span class="kc">null</span><span class="o">)</span> <span class="o">?</span> <span class="nx">nextCoord</span><span class="o">[</span><span class="m">1</span><span class="o">]</span> <span class="o">:</span> <span class="k">this</span><span class="o">.</span><span class="nx">curCoord</span><span class="o">[</span><span class="m">1</span><span class="o">];</span>

            <span class="nx">nextCoord</span> <span class="o">=</span> <span class="nx">tmpX</span> <span class="o">!==</span> <span class="k">this</span><span class="o">.</span><span class="nx">curCoord</span><span class="o">[</span><span class="m">0</span><span class="o">]</span> <span class="o">||</span> <span class="nx">tmpY</span> <span class="o">!==</span> <span class="k">this</span><span class="o">.</span><span class="nx">curCoord</span><span class="o">[</span><span class="m">1</span><span class="o">]</span> <span class="o">?</span>
                <span class="o">[</span> <span class="nx">tmpX</span><span class="o">,</span> <span class="nx">tmpY</span> <span class="o">]</span> <span class="o">:</span> <span class="kc">null</span><span class="o">;</span>
        <span class="o">}</span> <span class="k">else</span> <span class="k">if</span> <span class="o">(</span><span class="nx">t</span><span class="o">.</span><span class="nx">_isHoriz</span><span class="o">)</span> <span class="o">{</span>
            <span class="nx">nextCoord</span> <span class="o">=</span> <span class="k">this</span><span class="o">.</span><span class="nx">_getNextX</span><span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">curCoord</span><span class="o">,</span> <span class="nx">finalCoord</span><span class="o">);</span>
        <span class="o">}</span> <span class="k">else</span> <span class="o">{</span>
            <span class="nx">nextCoord</span> <span class="o">=</span> <span class="k">this</span><span class="o">.</span><span class="nx">_getNextY</span><span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">curCoord</span><span class="o">,</span> <span class="nx">finalCoord</span><span class="o">);</span>
        <span class="o">}</span>

        <span class="k">this</span><span class="o">.</span><span class="nx">logger</span><span class="o">.</span><span class="nx">log</span><span class="o">(</span><span class="s2">&quot;moveOneTick: &quot;</span> <span class="o">+</span> 
                <span class="s2">&quot; finalCoord: &quot;</span> <span class="o">+</span> <span class="nx">finalCoord</span> <span class="o">+</span>
                <span class="s2">&quot; this.curCoord: &quot;</span> <span class="o">+</span> <span class="k">this</span><span class="o">.</span><span class="nx">curCoord</span> <span class="o">+</span>
                <span class="s2">&quot; nextCoord: &quot;</span> <span class="o">+</span> <span class="nx">nextCoord</span><span class="o">);</span>

        <span class="k">if</span> <span class="o">(</span><span class="nx">nextCoord</span><span class="o">)</span> <span class="o">{</span>

            <span class="c">// cache the position</span>
<span class="c"></span>            <span class="k">this</span><span class="o">.</span><span class="nx">curCoord</span> <span class="o">=</span> <span class="nx">nextCoord</span><span class="o">;</span>

            <span class="c">// move to the next coord</span>
<span class="c"></span>            <span class="k">this</span><span class="o">.</span><span class="nx">thumb</span><span class="o">.</span><span class="nx">alignElWithMouse</span><span class="o">(</span><span class="nx">t</span><span class="o">.</span><span class="nx">getEl</span><span class="o">(),</span> <span class="nx">nextCoord</span><span class="o">[</span><span class="m">0</span><span class="o">]</span> <span class="o">+</span> <span class="k">this</span><span class="o">.</span><span class="nx">thumbCenterPoint</span><span class="o">.</span><span class="nx">x</span><span class="o">,</span> <span class="nx">nextCoord</span><span class="o">[</span><span class="m">1</span><span class="o">]</span> <span class="o">+</span> <span class="k">this</span><span class="o">.</span><span class="nx">thumbCenterPoint</span><span class="o">.</span><span class="nx">y</span><span class="o">);</span>
            
            <span class="c">// check if we are in the final position, if not make a recursive call</span>
<span class="c"></span>            <span class="k">if</span> <span class="o">(!(</span><span class="nx">nextCoord</span><span class="o">[</span><span class="m">0</span><span class="o">]</span> <span class="o">==</span> <span class="nx">finalCoord</span><span class="o">[</span><span class="m">0</span><span class="o">]</span> <span class="o">&amp;&amp;</span> <span class="nx">nextCoord</span><span class="o">[</span><span class="m">1</span><span class="o">]</span> <span class="o">==</span> <span class="nx">finalCoord</span><span class="o">[</span><span class="m">1</span><span class="o">]))</span> <span class="o">{</span>
                <span class="nx">setTimeout</span><span class="o">(</span><span class="k">function</span><span class="o">()</span> <span class="o">{</span> <span class="nx">self</span><span class="o">.</span><span class="nx">moveOneTick</span><span class="o">(</span><span class="nx">finalCoord</span><span class="o">);</span> <span class="o">},</span> 
                        <span class="k">this</span><span class="o">.</span><span class="nx">tickPause</span><span class="o">);</span>
            <span class="o">}</span> <span class="k">else</span> <span class="o">{</span>
                <span class="k">this</span><span class="o">.</span><span class="nx">unlock</span><span class="o">();</span>
                <span class="k">if</span> <span class="o">(!</span><span class="k">this</span><span class="o">.</span><span class="nx">_mouseDown</span><span class="o">)</span> <span class="o">{</span>
                    <span class="k">this</span><span class="o">.</span><span class="nx">endMove</span><span class="o">();</span>
                <span class="o">}</span>
            <span class="o">}</span>
        <span class="o">}</span> <span class="k">else</span> <span class="o">{</span>
            <span class="k">this</span><span class="o">.</span><span class="nx">unlock</span><span class="o">();</span>
            <span class="k">if</span> <span class="o">(!</span><span class="k">this</span><span class="o">.</span><span class="nx">_mouseDown</span><span class="o">)</span> <span class="o">{</span>
                <span class="k">this</span><span class="o">.</span><span class="nx">endMove</span><span class="o">();</span>
            <span class="o">}</span>
        <span class="o">}</span>
    <span class="o">},</span>

    <span class="c">/**</span>
<span class="c">     * Returns the next X tick value based on the current coord and the target coord.</span>
<span class="c">     * @method _getNextX</span>
<span class="c">     * @private</span>
<span class="c">     */</span>
    <span class="nx">_getNextX</span><span class="o">:</span> <span class="k">function</span><span class="o">(</span><span class="nx">curCoord</span><span class="o">,</span> <span class="nx">finalCoord</span><span class="o">)</span> <span class="o">{</span>
        <span class="k">this</span><span class="o">.</span><span class="nx">logger</span><span class="o">.</span><span class="nx">log</span><span class="o">(</span><span class="s2">&quot;getNextX: &quot;</span> <span class="o">+</span> <span class="nx">curCoord</span> <span class="o">+</span> <span class="s2">&quot;, &quot;</span> <span class="o">+</span> <span class="nx">finalCoord</span><span class="o">);</span>
        <span class="k">var</span> <span class="nx">t</span> <span class="o">=</span> <span class="k">this</span><span class="o">.</span><span class="nx">thumb</span><span class="o">,</span>
            <span class="nx">thresh</span><span class="o">,</span>
            <span class="nx">tmp</span> <span class="o">=</span> <span class="o">[],</span>
            <span class="nx">nextCoord</span> <span class="o">=</span> <span class="kc">null</span><span class="o">;</span>

        <span class="k">if</span> <span class="o">(</span><span class="nx">curCoord</span><span class="o">[</span><span class="m">0</span><span class="o">]</span> <span class="o">&gt;</span> <span class="nx">finalCoord</span><span class="o">[</span><span class="m">0</span><span class="o">])</span> <span class="o">{</span>
            <span class="nx">thresh</span> <span class="o">=</span> <span class="nx">t</span><span class="o">.</span><span class="nx">tickSize</span> <span class="o">-</span> <span class="k">this</span><span class="o">.</span><span class="nx">thumbCenterPoint</span><span class="o">.</span><span class="nx">x</span><span class="o">;</span>
            <span class="nx">tmp</span> <span class="o">=</span> <span class="nx">t</span><span class="o">.</span><span class="nx">getTargetCoord</span><span class="o">(</span> <span class="nx">curCoord</span><span class="o">[</span><span class="m">0</span><span class="o">]</span> <span class="o">-</span> <span class="nx">thresh</span><span class="o">,</span> <span class="nx">curCoord</span><span class="o">[</span><span class="m">1</span><span class="o">]</span> <span class="o">);</span>
            <span class="nx">nextCoord</span> <span class="o">=</span> <span class="o">[</span><span class="nx">tmp</span><span class="o">.</span><span class="nx">x</span><span class="o">,</span> <span class="nx">tmp</span><span class="o">.</span><span class="nx">y</span><span class="o">];</span>
        <span class="o">}</span> <span class="k">else</span> <span class="k">if</span> <span class="o">(</span><span class="nx">curCoord</span><span class="o">[</span><span class="m">0</span><span class="o">]</span> <span class="o">&lt;</span> <span class="nx">finalCoord</span><span class="o">[</span><span class="m">0</span><span class="o">])</span> <span class="o">{</span>
            <span class="nx">thresh</span> <span class="o">=</span> <span class="nx">t</span><span class="o">.</span><span class="nx">tickSize</span> <span class="o">+</span> <span class="k">this</span><span class="o">.</span><span class="nx">thumbCenterPoint</span><span class="o">.</span><span class="nx">x</span><span class="o">;</span>
            <span class="nx">tmp</span> <span class="o">=</span> <span class="nx">t</span><span class="o">.</span><span class="nx">getTargetCoord</span><span class="o">(</span> <span class="nx">curCoord</span><span class="o">[</span><span class="m">0</span><span class="o">]</span> <span class="o">+</span> <span class="nx">thresh</span><span class="o">,</span> <span class="nx">curCoord</span><span class="o">[</span><span class="m">1</span><span class="o">]</span> <span class="o">);</span>
            <span class="nx">nextCoord</span> <span class="o">=</span> <span class="o">[</span><span class="nx">tmp</span><span class="o">.</span><span class="nx">x</span><span class="o">,</span> <span class="nx">tmp</span><span class="o">.</span><span class="nx">y</span><span class="o">];</span>
        <span class="o">}</span> <span class="k">else</span> <span class="o">{</span>
            <span class="c">// equal, do nothing</span>
<span class="c"></span>        <span class="o">}</span>

        <span class="k">return</span> <span class="nx">nextCoord</span><span class="o">;</span>
    <span class="o">},</span>

    <span class="c">/**</span>
<span class="c">     * Returns the next Y tick value based on the current coord and the target coord.</span>
<span class="c">     * @method _getNextY</span>
<span class="c">     * @private</span>
<span class="c">     */</span>
    <span class="nx">_getNextY</span><span class="o">:</span> <span class="k">function</span><span class="o">(</span><span class="nx">curCoord</span><span class="o">,</span> <span class="nx">finalCoord</span><span class="o">)</span> <span class="o">{</span>
        <span class="k">var</span> <span class="nx">t</span> <span class="o">=</span> <span class="k">this</span><span class="o">.</span><span class="nx">thumb</span><span class="o">,</span>
            <span class="nx">thresh</span><span class="o">,</span>
            <span class="nx">tmp</span> <span class="o">=</span> <span class="o">[],</span>
            <span class="nx">nextCoord</span> <span class="o">=</span> <span class="kc">null</span><span class="o">;</span>

        <span class="k">if</span> <span class="o">(</span><span class="nx">curCoord</span><span class="o">[</span><span class="m">1</span><span class="o">]</span> <span class="o">&gt;</span> <span class="nx">finalCoord</span><span class="o">[</span><span class="m">1</span><span class="o">])</span> <span class="o">{</span>
            <span class="nx">thresh</span> <span class="o">=</span> <span class="nx">t</span><span class="o">.</span><span class="nx">tickSize</span> <span class="o">-</span> <span class="k">this</span><span class="o">.</span><span class="nx">thumbCenterPoint</span><span class="o">.</span><span class="nx">y</span><span class="o">;</span>
            <span class="nx">tmp</span> <span class="o">=</span> <span class="nx">t</span><span class="o">.</span><span class="nx">getTargetCoord</span><span class="o">(</span> <span class="nx">curCoord</span><span class="o">[</span><span class="m">0</span><span class="o">],</span> <span class="nx">curCoord</span><span class="o">[</span><span class="m">1</span><span class="o">]</span> <span class="o">-</span> <span class="nx">thresh</span> <span class="o">);</span>
            <span class="nx">nextCoord</span> <span class="o">=</span> <span class="o">[</span><span class="nx">tmp</span><span class="o">.</span><span class="nx">x</span><span class="o">,</span> <span class="nx">tmp</span><span class="o">.</span><span class="nx">y</span><span class="o">];</span>
        <span class="o">}</span> <span class="k">else</span> <span class="k">if</span> <span class="o">(</span><span class="nx">curCoord</span><span class="o">[</span><span class="m">1</span><span class="o">]</span> <span class="o">&lt;</span> <span class="nx">finalCoord</span><span class="o">[</span><span class="m">1</span><span class="o">])</span> <span class="o">{</span>
            <span class="nx">thresh</span> <span class="o">=</span> <span class="nx">t</span><span class="o">.</span><span class="nx">tickSize</span> <span class="o">+</span> <span class="k">this</span><span class="o">.</span><span class="nx">thumbCenterPoint</span><span class="o">.</span><span class="nx">y</span><span class="o">;</span>
            <span class="nx">tmp</span> <span class="o">=</span> <span class="nx">t</span><span class="o">.</span><span class="nx">getTargetCoord</span><span class="o">(</span> <span class="nx">curCoord</span><span class="o">[</span><span class="m">0</span><span class="o">],</span> <span class="nx">curCoord</span><span class="o">[</span><span class="m">1</span><span class="o">]</span> <span class="o">+</span> <span class="nx">thresh</span> <span class="o">);</span>
            <span class="nx">nextCoord</span> <span class="o">=</span> <span class="o">[</span><span class="nx">tmp</span><span class="o">.</span><span class="nx">x</span><span class="o">,</span> <span class="nx">tmp</span><span class="o">.</span><span class="nx">y</span><span class="o">];</span>
        <span class="o">}</span> <span class="k">else</span> <span class="o">{</span>
            <span class="c">// equal, do nothing</span>
<span class="c"></span>        <span class="o">}</span>

        <span class="k">return</span> <span class="nx">nextCoord</span><span class="o">;</span>
    <span class="o">},</span>

    <span class="c">/**</span>
<span class="c">     * Resets the constraints before moving the thumb.</span>
<span class="c">     * @method b4MouseDown</span>
<span class="c">     * @private</span>
<span class="c">     */</span>
    <span class="nx">b4MouseDown</span><span class="o">:</span> <span class="k">function</span><span class="o">(</span><span class="nx">e</span><span class="o">)</span> <span class="o">{</span>
        <span class="k">if</span> <span class="o">(!</span><span class="k">this</span><span class="o">.</span><span class="nx">backgroundEnabled</span><span class="o">)</span> <span class="o">{</span>
            <span class="k">return</span> <span class="kc">false</span><span class="o">;</span>
        <span class="o">}</span>

        <span class="k">this</span><span class="o">.</span><span class="nx">thumb</span><span class="o">.</span><span class="nx">autoOffset</span><span class="o">();</span>
        <span class="k">this</span><span class="o">.</span><span class="nx">resetThumbConstraints</span><span class="o">();</span>
    <span class="o">},</span>

    <span class="c">/**</span>
<span class="c">     * Handles the mousedown event for the slider background</span>
<span class="c">     * @method onMouseDown</span>
<span class="c">     * @private</span>
<span class="c">     */</span>
    <span class="nx">onMouseDown</span><span class="o">:</span> <span class="k">function</span><span class="o">(</span><span class="nx">e</span><span class="o">)</span> <span class="o">{</span>
        <span class="k">if</span> <span class="o">(!</span><span class="k">this</span><span class="o">.</span><span class="nx">backgroundEnabled</span> <span class="o">||</span> <span class="k">this</span><span class="o">.</span><span class="nx">isLocked</span><span class="o">())</span> <span class="o">{</span>
            <span class="k">return</span> <span class="kc">false</span><span class="o">;</span>
        <span class="o">}</span>

        <span class="k">this</span><span class="o">.</span><span class="nx">_mouseDown</span> <span class="o">=</span> <span class="kc">true</span><span class="o">;</span>

        <span class="k">var</span> <span class="nx">x</span> <span class="o">=</span> <span class="nx">Event</span><span class="o">.</span><span class="nx">getPageX</span><span class="o">(</span><span class="nx">e</span><span class="o">),</span>
            <span class="nx">y</span> <span class="o">=</span> <span class="nx">Event</span><span class="o">.</span><span class="nx">getPageY</span><span class="o">(</span><span class="nx">e</span><span class="o">);</span>

        <span class="k">this</span><span class="o">.</span><span class="nx">logger</span><span class="o">.</span><span class="nx">log</span><span class="o">(</span><span class="s2">&quot;bg mousedown: &quot;</span> <span class="o">+</span> <span class="nx">x</span> <span class="o">+</span> <span class="s2">&quot;,&quot;</span> <span class="o">+</span> <span class="nx">y</span><span class="o">);</span>

        <span class="k">this</span><span class="o">.</span><span class="nx">focus</span><span class="o">();</span>
        <span class="k">this</span><span class="o">.</span><span class="nx">_slideStart</span><span class="o">();</span>
        <span class="k">this</span><span class="o">.</span><span class="nx">moveThumb</span><span class="o">(</span><span class="nx">x</span><span class="o">,</span> <span class="nx">y</span><span class="o">);</span>
    <span class="o">},</span>

    <span class="c">/**</span>
<span class="c">     * Handles the onDrag event for the slider background</span>
<span class="c">     * @method onDrag</span>
<span class="c">     * @private</span>
<span class="c">     */</span>
    <span class="nx">onDrag</span><span class="o">:</span> <span class="k">function</span><span class="o">(</span><span class="nx">e</span><span class="o">)</span> <span class="o">{</span>
        <span class="k">this</span><span class="o">.</span><span class="nx">logger</span><span class="o">.</span><span class="nx">log</span><span class="o">(</span><span class="s2">&quot;background drag&quot;</span><span class="o">);</span>
        <span class="k">if</span> <span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">backgroundEnabled</span> <span class="o">&amp;&amp;</span> <span class="o">!</span><span class="k">this</span><span class="o">.</span><span class="nx">isLocked</span><span class="o">())</span> <span class="o">{</span>
            <span class="k">var</span> <span class="nx">x</span> <span class="o">=</span> <span class="nx">Event</span><span class="o">.</span><span class="nx">getPageX</span><span class="o">(</span><span class="nx">e</span><span class="o">),</span>
                <span class="nx">y</span> <span class="o">=</span> <span class="nx">Event</span><span class="o">.</span><span class="nx">getPageY</span><span class="o">(</span><span class="nx">e</span><span class="o">);</span>
            <span class="k">this</span><span class="o">.</span><span class="nx">moveThumb</span><span class="o">(</span><span class="nx">x</span><span class="o">,</span> <span class="nx">y</span><span class="o">,</span> <span class="kc">true</span><span class="o">,</span> <span class="kc">true</span><span class="o">);</span>
            <span class="k">this</span><span class="o">.</span><span class="nx">fireEvents</span><span class="o">();</span>
        <span class="o">}</span>
    <span class="o">},</span>

    <span class="c">/**</span>
<span class="c">     * Fired when the slider movement ends</span>
<span class="c">     * @method endMove</span>
<span class="c">     * @private</span>
<span class="c">     */</span>
    <span class="nx">endMove</span><span class="o">:</span> <span class="k">function</span> <span class="o">()</span> <span class="o">{</span>
        <span class="k">this</span><span class="o">.</span><span class="nx">logger</span><span class="o">.</span><span class="nx">log</span><span class="o">(</span><span class="s2">&quot;endMove&quot;</span><span class="o">);</span>
        <span class="k">this</span><span class="o">.</span><span class="nx">unlock</span><span class="o">();</span>
        <span class="k">this</span><span class="o">.</span><span class="nx">fireEvents</span><span class="o">();</span>
        <span class="k">this</span><span class="o">.</span><span class="nx">moveComplete</span> <span class="o">=</span> <span class="kc">true</span><span class="o">;</span>
        <span class="k">this</span><span class="o">.</span><span class="nx">_slideEnd</span><span class="o">();</span>
    <span class="o">},</span>

    <span class="c">/**</span>
<span class="c">     * Resets the X and Y contraints for the thumb.  Used in lieu of the thumb</span>
<span class="c">     * instance&#39;s inherited resetConstraints because some logic was not</span>
<span class="c">     * applicable.</span>
<span class="c">     * @method resetThumbConstraints</span>
<span class="c">     * @protected</span>
<span class="c">     */</span>
    <span class="nx">resetThumbConstraints</span><span class="o">:</span> <span class="k">function</span> <span class="o">()</span> <span class="o">{</span>
        <span class="k">var</span> <span class="nx">t</span> <span class="o">=</span> <span class="k">this</span><span class="o">.</span><span class="nx">thumb</span><span class="o">;</span>

        <span class="nx">t</span><span class="o">.</span><span class="nx">setXConstraint</span><span class="o">(</span><span class="nx">t</span><span class="o">.</span><span class="nx">leftConstraint</span><span class="o">,</span> <span class="nx">t</span><span class="o">.</span><span class="nx">rightConstraint</span><span class="o">,</span> <span class="nx">t</span><span class="o">.</span><span class="nx">xTickSize</span><span class="o">);</span>
        <span class="nx">t</span><span class="o">.</span><span class="nx">setYConstraint</span><span class="o">(</span><span class="nx">t</span><span class="o">.</span><span class="nx">topConstraint</span><span class="o">,</span> <span class="nx">t</span><span class="o">.</span><span class="nx">bottomConstraint</span><span class="o">,</span> <span class="nx">t</span><span class="o">.</span><span class="nx">xTickSize</span><span class="o">);</span>
    <span class="o">},</span>

    <span class="c">/**</span>
<span class="c">     * Fires the change event if the value has been changed.  Ignored if we are in</span>
<span class="c">     * the middle of an animation as the event will fire when the animation is</span>
<span class="c">     * complete</span>
<span class="c">     * @method fireEvents</span>
<span class="c">     * @param {boolean} thumbEvent set to true if this event is fired from an event</span>
<span class="c">     *                  that occurred on the thumb.  If it is, the state of the</span>
<span class="c">     *                  thumb dd object should be correct.  Otherwise, the event</span>
<span class="c">     *                  originated on the background, so the thumb state needs to</span>
<span class="c">     *                  be refreshed before proceeding.</span>
<span class="c">     * @private</span>
<span class="c">     */</span>
    <span class="nx">fireEvents</span><span class="o">:</span> <span class="k">function</span> <span class="o">(</span><span class="nx">thumbEvent</span><span class="o">)</span> <span class="o">{</span>

        <span class="k">var</span> <span class="nx">t</span> <span class="o">=</span> <span class="k">this</span><span class="o">.</span><span class="nx">thumb</span><span class="o">,</span> <span class="nx">newX</span><span class="o">,</span> <span class="nx">newY</span><span class="o">,</span> <span class="nx">newVal</span><span class="o">;</span>

        <span class="k">if</span> <span class="o">(!</span><span class="nx">thumbEvent</span><span class="o">)</span> <span class="o">{</span>
            <span class="nx">t</span><span class="o">.</span><span class="nx">cachePosition</span><span class="o">();</span>
        <span class="o">}</span>

        <span class="k">if</span> <span class="o">(!</span> <span class="k">this</span><span class="o">.</span><span class="nx">isLocked</span><span class="o">())</span> <span class="o">{</span>
            <span class="k">if</span> <span class="o">(</span><span class="nx">t</span><span class="o">.</span><span class="nx">_isRegion</span><span class="o">)</span> <span class="o">{</span>
                <span class="nx">newX</span> <span class="o">=</span> <span class="nx">t</span><span class="o">.</span><span class="nx">getXValue</span><span class="o">();</span>
                <span class="nx">newY</span> <span class="o">=</span> <span class="nx">t</span><span class="o">.</span><span class="nx">getYValue</span><span class="o">();</span>

                <span class="k">if</span> <span class="o">(</span><span class="nx">newX</span> <span class="o">!=</span> <span class="k">this</span><span class="o">.</span><span class="nx">previousX</span> <span class="o">||</span> <span class="nx">newY</span> <span class="o">!=</span> <span class="k">this</span><span class="o">.</span><span class="nx">previousY</span><span class="o">)</span> <span class="o">{</span>
                    <span class="k">if</span> <span class="o">(!</span><span class="k">this</span><span class="o">.</span><span class="nx">_silent</span><span class="o">)</span> <span class="o">{</span>
                        <span class="k">this</span><span class="o">.</span><span class="nx">onChange</span><span class="o">(</span><span class="nx">newX</span><span class="o">,</span> <span class="nx">newY</span><span class="o">);</span>
                        <span class="k">this</span><span class="o">.</span><span class="nx">fireEvent</span><span class="o">(</span><span class="s2">&quot;change&quot;</span><span class="o">,</span> <span class="o">{</span> <span class="nx">x</span><span class="o">:</span> <span class="nx">newX</span><span class="o">,</span> <span class="nx">y</span><span class="o">:</span> <span class="nx">newY</span> <span class="o">});</span>
                    <span class="o">}</span>
                <span class="o">}</span>

                <span class="k">this</span><span class="o">.</span><span class="nx">previousX</span> <span class="o">=</span> <span class="nx">newX</span><span class="o">;</span>
                <span class="k">this</span><span class="o">.</span><span class="nx">previousY</span> <span class="o">=</span> <span class="nx">newY</span><span class="o">;</span>

            <span class="o">}</span> <span class="k">else</span> <span class="o">{</span>
                <span class="nx">newVal</span> <span class="o">=</span> <span class="nx">t</span><span class="o">.</span><span class="nx">getValue</span><span class="o">();</span>
                <span class="k">if</span> <span class="o">(</span><span class="nx">newVal</span> <span class="o">!=</span> <span class="k">this</span><span class="o">.</span><span class="nx">previousVal</span><span class="o">)</span> <span class="o">{</span>
                    <span class="k">this</span><span class="o">.</span><span class="nx">logger</span><span class="o">.</span><span class="nx">log</span><span class="o">(</span><span class="s2">&quot;Firing onchange: &quot;</span> <span class="o">+</span> <span class="nx">newVal</span><span class="o">);</span>
                    <span class="k">if</span> <span class="o">(!</span><span class="k">this</span><span class="o">.</span><span class="nx">_silent</span><span class="o">)</span> <span class="o">{</span>
                        <span class="k">this</span><span class="o">.</span><span class="nx">onChange</span><span class="o">(</span> <span class="nx">newVal</span> <span class="o">);</span>
                        <span class="k">this</span><span class="o">.</span><span class="nx">fireEvent</span><span class="o">(</span><span class="s2">&quot;change&quot;</span><span class="o">,</span> <span class="nx">newVal</span><span class="o">);</span>
                    <span class="o">}</span>
                <span class="o">}</span>
                <span class="k">this</span><span class="o">.</span><span class="nx">previousVal</span> <span class="o">=</span> <span class="nx">newVal</span><span class="o">;</span>
            <span class="o">}</span>

        <span class="o">}</span>
    <span class="o">},</span>

    <span class="c">/**</span>
<span class="c">     * Slider toString</span>
<span class="c">     * @method toString</span>
<span class="c">     * @return {string} string representation of the instance</span>
<span class="c">     */</span>
    <span class="nx">toString</span><span class="o">:</span> <span class="k">function</span> <span class="o">()</span> <span class="o">{</span> 
        <span class="k">return</span> <span class="o">(</span><span class="s2">&quot;Slider (&quot;</span> <span class="o">+</span> <span class="k">this</span><span class="o">.</span><span class="nx">type</span> <span class="o">+</span><span class="s2">&quot;) &quot;</span> <span class="o">+</span> <span class="k">this</span><span class="o">.</span><span class="nx">id</span><span class="o">);</span>
    <span class="o">}</span>

<span class="o">});</span>

<span class="nx">YAHOO</span><span class="o">.</span><span class="nx">lang</span><span class="o">.</span><span class="nx">augmentProto</span><span class="o">(</span><span class="nx">Slider</span><span class="o">,</span> <span class="nx">YAHOO</span><span class="o">.</span><span class="nx">util</span><span class="o">.</span><span class="nx">EventProvider</span><span class="o">);</span>

<span class="nx">YAHOO</span><span class="o">.</span><span class="nx">widget</span><span class="o">.</span><span class="nx">Slider</span> <span class="o">=</span> <span class="nx">Slider</span><span class="o">;</span>
<span class="o">})();</span>
</pre></div>
                    </div>
			</div>
		</div>
		<div class="yui-b">
            <div class="nav">

                    <div id="moduleList" class="module">
                        <h4>Modules</h4>
                        <ul class="content">
                                <li class=""><a href="module_animation.html" title="animation">animation</a></li>
                                <li class=""><a href="module_autocomplete.html" title="autocomplete">autocomplete</a></li>
                                <li class=""><a href="module_button.html" title="button">button</a></li>
                                <li class=""><a href="module_calendar.html" title="calendar">calendar</a></li>
                                <li class=""><a href="module_carousel.html" title="carousel">carousel</a></li>
                                <li class=""><a href="module_charts.html" title="charts">charts</a></li>
                                <li class=""><a href="module_colorpicker.html" title="colorpicker">colorpicker</a></li>
                                <li class=""><a href="module_connection.html" title="connection">connection</a></li>
                                <li class=""><a href="module_container.html" title="container">container</a></li>
                                <li class=""><a href="module_cookie.html" title="cookie">cookie</a></li>
                                <li class=""><a href="module_datasource.html" title="datasource">datasource</a></li>
                                <li class=""><a href="module_datatable.html" title="datatable">datatable</a></li>
                                <li class=""><a href="module_dom.html" title="dom">dom</a></li>
                                <li class=""><a href="module_dragdrop.html" title="dragdrop">dragdrop</a></li>
                                <li class=""><a href="module_editor.html" title="editor">editor</a></li>
                                <li class=""><a href="module_element.html" title="element">element</a></li>
                                <li class=""><a href="module_event.html" title="event">event</a></li>
                                <li class=""><a href="module_get.html" title="get">get</a></li>
                                <li class=""><a href="module_history.html" title="history">history</a></li>
                                <li class=""><a href="module_imagecropper.html" title="imagecropper">imagecropper</a></li>
                                <li class=""><a href="module_imageloader.html" title="imageloader">imageloader</a></li>
                                <li class=""><a href="module_json.html" title="json">json</a></li>
                                <li class=""><a href="module_layout.html" title="layout">layout</a></li>
                                <li class=""><a href="module_logger.html" title="logger">logger</a></li>
                                <li class=""><a href="module_menu.html" title="menu">menu</a></li>
                                <li class=""><a href="module_paginator.html" title="paginator">paginator</a></li>
                                <li class=""><a href="module_profiler.html" title="profiler">profiler</a></li>
                                <li class=""><a href="module_profilerviewer.html" title="profilerviewer">profilerviewer</a></li>
                                <li class=""><a href="module_resize.html" title="resize">resize</a></li>
                                <li class=""><a href="module_selector.html" title="selector">selector</a></li>
                                <li class="selected"><a href="module_slider.html" title="slider">slider</a></li>
                                <li class=""><a href="module_stylesheet.html" title="stylesheet">stylesheet</a></li>
                                <li class=""><a href="module_tabview.html" title="tabview">tabview</a></li>
                                <li class=""><a href="module_treeview.html" title="treeview">treeview</a></li>
                                <li class=""><a href="module_uploader.html" title="uploader">uploader</a></li>
                                <li class=""><a href="module_yahoo.html" title="yahoo">yahoo</a></li>
                                <li class=""><a href="module_yuiloader.html" title="yuiloader">yuiloader</a></li>
                                <li class=""><a href="module_yuitest.html" title="yuitest">yuitest</a></li>
                        </ul>
                    </div>

                    <div id="classList" class="module">
                        <h4>Classes</h4>
                        <ul class="content">
                                <li class=""><a href="YAHOO.widget.DualSlider.html" title="YAHOO.widget.DualSlider">YAHOO.widget.DualSlider</a></li>
                                <li class=""><a href="YAHOO.widget.Slider.html" title="YAHOO.widget.Slider">YAHOO.widget.Slider</a></li>
                                <li class=""><a href="YAHOO.widget.SliderThumb.html" title="YAHOO.widget.SliderThumb">YAHOO.widget.SliderThumb</a></li>
                        </ul>
                    </div>

                    <div id="fileList" class="module">
                        <h4>Files</h4>
                        <ul class="content">        
                                <li class=""><a href="DualSlider.js.html" title="DualSlider.js">DualSlider.js</a></li>
                                <li class="selected"><a href="Slider.js.html" title="Slider.js">Slider.js</a></li>
                                <li class=""><a href="SliderThumb.js.html" title="SliderThumb.js">SliderThumb.js</a></li>
                        </ul>
                    </div>





            </div>
		</div>
	</div>
	<div id="ft">
        <hr />
        Copyright &copy; 2009 Yahoo! Inc. All rights reserved.
	</div>
</div>
<script type="text/javascript">
    ALL_YUI_PROPS = [{"access": "", "host": "YAHOO.widget.DualSlider", "name": "activeSlider", "url": "YAHOO.widget.DualSlider.html#property_activeSlider", "type": "property"}, {"access": "", "host": "YAHOO.widget.Slider", "name": "animate", "url": "YAHOO.widget.Slider.html#property_animate", "type": "property"}, {"access": "", "host": "YAHOO.widget.Slider", "name": "animationDuration", "url": "YAHOO.widget.Slider.html#property_animationDuration", "type": "property"}, {"access": "private", "host": "YAHOO.widget.Slider", "name": "b4MouseDown", "url": "YAHOO.widget.Slider.html#method_b4MouseDown", "type": "method"}, {"access": "", "host": "YAHOO.widget.Slider", "name": "backgroundEnabled", "url": "YAHOO.widget.Slider.html#property_backgroundEnabled", "type": "property"}, {"access": "", "host": "YAHOO.widget.Slider", "name": "baselinePos", "url": "YAHOO.widget.Slider.html#property_baselinePos", "type": "property"}, {"access": "protected", "host": "YAHOO.widget.Slider", "name": "_bindKeyEvents", "url": "YAHOO.widget.Slider.html#method__bindKeyEvents", "type": "method"}, {"access": "protected", "host": "YAHOO.widget.DualSlider", "name": "_bindKeyEvents", "url": "YAHOO.widget.DualSlider.html#method__bindKeyEvents", "type": "method"}, {"access": "", "host": "YAHOO.widget.Slider", "name": "change", "url": "YAHOO.widget.Slider.html#event_change", "type": "event"}, {"access": "", "host": "YAHOO.widget.DualSlider", "name": "change", "url": "YAHOO.widget.DualSlider.html#event_change", "type": "event"}, {"access": "private", "host": "YAHOO.widget.DualSlider", "name": "_cleanEvent", "url": "YAHOO.widget.DualSlider.html#method__cleanEvent", "type": "method"}, {"access": "", "host": "YAHOO.widget.SliderThumb", "name": "clearTicks", "url": "YAHOO.widget.SliderThumb.html#method_clearTicks", "type": "method"}, {"access": "", "host": "YAHOO.widget.Slider", "name": "dragOnly", "url": "YAHOO.widget.Slider.html#property_dragOnly", "type": "property"}, {"access": "", "host": "YAHOO.widget.SliderThumb", "name": "dragOnly", "url": "YAHOO.widget.SliderThumb.html#property_dragOnly", "type": "property"}, {"access": "", "host": "YAHOO.widget.Slider", "name": "enableKeys", "url": "YAHOO.widget.Slider.html#property_enableKeys", "type": "property"}, {"access": "private", "host": "YAHOO.widget.Slider", "name": "endMove", "url": "YAHOO.widget.Slider.html#method_endMove", "type": "method"}, {"access": "private", "host": "YAHOO.widget.Slider", "name": "fireEvents", "url": "YAHOO.widget.Slider.html#method_fireEvents", "type": "method"}, {"access": "private", "host": "YAHOO.widget.Slider", "name": "focus", "url": "YAHOO.widget.Slider.html#method_focus", "type": "method"}, {"access": "private", "host": "YAHOO.widget.Slider", "name": "_getNextX", "url": "YAHOO.widget.Slider.html#method__getNextX", "type": "method"}, {"access": "private", "host": "YAHOO.widget.Slider", "name": "_getNextY", "url": "YAHOO.widget.Slider.html#method__getNextY", "type": "method"}, {"access": "", "host": "YAHOO.widget.SliderThumb", "name": "getOffsetFromParent", "url": "YAHOO.widget.SliderThumb.html#method_getOffsetFromParent", "type": "method"}, {"access": "", "host": "YAHOO.widget.Slider", "name": "getThumb", "url": "YAHOO.widget.Slider.html#method_getThumb", "type": "method"}, {"access": "", "host": "YAHOO.widget.Slider", "name": "getValue", "url": "YAHOO.widget.Slider.html#method_getValue", "type": "method"}, {"access": "", "host": "YAHOO.widget.SliderThumb", "name": "getValue", "url": "YAHOO.widget.SliderThumb.html#method_getValue", "type": "method"}, {"access": "", "host": "YAHOO.widget.Slider", "name": "getXValue", "url": "YAHOO.widget.Slider.html#method_getXValue", "type": "method"}, {"access": "", "host": "YAHOO.widget.SliderThumb", "name": "getXValue", "url": "YAHOO.widget.SliderThumb.html#method_getXValue", "type": "method"}, {"access": "", "host": "YAHOO.widget.Slider", "name": "getYValue", "url": "YAHOO.widget.Slider.html#method_getYValue", "type": "method"}, {"access": "", "host": "YAHOO.widget.SliderThumb", "name": "getYValue", "url": "YAHOO.widget.SliderThumb.html#method_getYValue", "type": "method"}, {"access": "private", "host": "YAHOO.widget.SliderThumb", "name": "_graduated", "url": "YAHOO.widget.SliderThumb.html#property__graduated", "type": "property"}, {"access": "private", "host": "YAHOO.widget.DualSlider", "name": "_handleDrag", "url": "YAHOO.widget.DualSlider.html#method__handleDrag", "type": "method"}, {"access": "", "host": "YAHOO.widget.Slider", "name": "handleKeyDown", "url": "YAHOO.widget.Slider.html#method_handleKeyDown", "type": "method"}, {"access": "protected", "host": "YAHOO.widget.DualSlider", "name": "_handleKeyDown", "url": "YAHOO.widget.DualSlider.html#method__handleKeyDown", "type": "method"}, {"access": "", "host": "YAHOO.widget.Slider", "name": "handleKeyPress", "url": "YAHOO.widget.Slider.html#method_handleKeyPress", "type": "method"}, {"access": "protected", "host": "YAHOO.widget.DualSlider", "name": "_handleKeyPress", "url": "YAHOO.widget.DualSlider.html#method__handleKeyPress", "type": "method"}, {"access": "private", "host": "YAHOO.widget.DualSlider", "name": "_handleMaxChange", "url": "YAHOO.widget.DualSlider.html#method__handleMaxChange", "type": "method"}, {"access": "private", "host": "YAHOO.widget.DualSlider", "name": "_handleMinChange", "url": "YAHOO.widget.DualSlider.html#method__handleMinChange", "type": "method"}, {"access": "protected", "host": "YAHOO.widget.DualSlider", "name": "_handleMouseDown", "url": "YAHOO.widget.DualSlider.html#method__handleMouseDown", "type": "method"}, {"access": "protected", "host": "YAHOO.widget.DualSlider", "name": "_handleMouseUp", "url": "YAHOO.widget.DualSlider.html#method__handleMouseUp", "type": "method"}, {"access": "private", "host": "YAHOO.widget.DualSlider", "name": "_handleSlideEnd", "url": "YAHOO.widget.DualSlider.html#method__handleSlideEnd", "type": "method"}, {"access": "private", "host": "YAHOO.widget.DualSlider", "name": "_handleSlideStart", "url": "YAHOO.widget.DualSlider.html#method__handleSlideStart", "type": "method"}, {"access": "", "host": "YAHOO.widget.Slider", "name": "initSlider", "url": "YAHOO.widget.Slider.html#method_initSlider", "type": "method"}, {"access": "", "host": "YAHOO.widget.SliderThumb", "name": "initSlider", "url": "YAHOO.widget.SliderThumb.html#method_initSlider", "type": "method"}, {"access": "", "host": "YAHOO.widget.Slider", "name": "initThumb", "url": "YAHOO.widget.Slider.html#method_initThumb", "type": "method"}, {"access": "private", "host": "YAHOO.widget.SliderThumb", "name": "_isHoriz", "url": "YAHOO.widget.SliderThumb.html#property__isHoriz", "type": "property"}, {"access": "", "host": "YAHOO.widget.DualSlider", "name": "isHoriz", "url": "YAHOO.widget.DualSlider.html#property_isHoriz", "type": "property"}, {"access": "private", "host": "YAHOO.widget.Slider", "name": "isTarget", "url": "YAHOO.widget.Slider.html#property_isTarget", "type": "property"}, {"access": "private", "host": "YAHOO.widget.SliderThumb", "name": "isTarget", "url": "YAHOO.widget.SliderThumb.html#property_isTarget", "type": "property"}, {"access": "", "host": "YAHOO.widget.Slider", "name": "keyIncrement", "url": "YAHOO.widget.Slider.html#property_keyIncrement", "type": "property"}, {"access": "", "host": "YAHOO.widget.Slider", "name": "lastOffset", "url": "YAHOO.widget.Slider.html#property_lastOffset", "type": "property"}, {"access": "", "host": "YAHOO.widget.Slider", "name": "lock", "url": "YAHOO.widget.Slider.html#method_lock", "type": "method"}, {"access": "private", "host": "YAHOO.widget.SliderThumb", "name": "maintainOffset", "url": "YAHOO.widget.SliderThumb.html#property_maintainOffset", "type": "property"}, {"access": "", "host": "YAHOO.widget.DualSlider", "name": "maxSlider", "url": "YAHOO.widget.DualSlider.html#property_maxSlider", "type": "property"}, {"access": "", "host": "YAHOO.widget.DualSlider", "name": "maxVal", "url": "YAHOO.widget.DualSlider.html#property_maxVal", "type": "property"}, {"access": "", "host": "YAHOO.widget.DualSlider", "name": "minRange", "url": "YAHOO.widget.DualSlider.html#property_minRange", "type": "property"}, {"access": "", "host": "YAHOO.widget.DualSlider", "name": "minSlider", "url": "YAHOO.widget.DualSlider.html#property_minSlider", "type": "property"}, {"access": "", "host": "YAHOO.widget.DualSlider", "name": "minVal", "url": "YAHOO.widget.DualSlider.html#property_minVal", "type": "property"}, {"access": "private", "host": "YAHOO.widget.Slider", "name": "_mouseDown", "url": "YAHOO.widget.Slider.html#property__mouseDown", "type": "property"}, {"access": "", "host": "YAHOO.widget.Slider", "name": "moveComplete", "url": "YAHOO.widget.Slider.html#property_moveComplete", "type": "property"}, {"access": "private", "host": "YAHOO.widget.Slider", "name": "moveOneTick", "url": "YAHOO.widget.Slider.html#method_moveOneTick", "type": "method"}, {"access": "private", "host": "YAHOO.widget.Slider", "name": "moveThumb", "url": "YAHOO.widget.Slider.html#method_moveThumb", "type": "method"}, {"access": "", "host": "YAHOO.widget.Slider", "name": "onAvailable", "url": "YAHOO.widget.Slider.html#method_onAvailable", "type": "method"}, {"access": "", "host": "YAHOO.widget.Slider", "name": "onChange", "url": "YAHOO.widget.Slider.html#method_onChange", "type": "method"}, {"access": "private", "host": "YAHOO.widget.SliderThumb", "name": "onChange", "url": "YAHOO.widget.SliderThumb.html#method_onChange", "type": "method"}, {"access": "private", "host": "YAHOO.widget.Slider", "name": "onDrag", "url": "YAHOO.widget.Slider.html#method_onDrag", "type": "method"}, {"access": "private", "host": "YAHOO.widget.DualSlider", "name": "_oneTimeCallback", "url": "YAHOO.widget.DualSlider.html#method__oneTimeCallback", "type": "method"}, {"access": "private", "host": "YAHOO.widget.Slider", "name": "onMouseDown", "url": "YAHOO.widget.Slider.html#method_onMouseDown", "type": "method"}, {"access": "", "host": "YAHOO.widget.Slider", "name": "onSliderEnd", "url": "YAHOO.widget.Slider.html#method_onSliderEnd", "type": "method"}, {"access": "", "host": "YAHOO.widget.Slider", "name": "onSlideStart", "url": "YAHOO.widget.Slider.html#method_onSlideStart", "type": "method"}, {"access": "", "host": "YAHOO.widget.SliderThumb", "name": "parentElId", "url": "YAHOO.widget.SliderThumb.html#property_parentElId", "type": "property"}, {"access": "private", "host": "YAHOO.widget.SliderThumb", "name": "_prevVal", "url": "YAHOO.widget.SliderThumb.html#property__prevVal", "type": "property"}, {"access": "", "host": "YAHOO.widget.DualSlider", "name": "ready", "url": "YAHOO.widget.DualSlider.html#event_ready", "type": "event"}, {"access": "protected", "host": "YAHOO.widget.Slider", "name": "resetThumbConstraints", "url": "YAHOO.widget.Slider.html#method_resetThumbConstraints", "type": "method"}, {"access": "private", "host": "YAHOO.widget.SliderThumb", "name": "scroll", "url": "YAHOO.widget.SliderThumb.html#property_scroll", "type": "property"}, {"access": "private", "host": "YAHOO.widget.DualSlider", "name": "selectActiveSlider", "url": "YAHOO.widget.DualSlider.html#method_selectActiveSlider", "type": "method"}, {"access": "", "host": "YAHOO.widget.DualSlider", "name": "setMaxValue", "url": "YAHOO.widget.DualSlider.html#method_setMaxValue", "type": "method"}, {"access": "", "host": "YAHOO.widget.DualSlider", "name": "setMinValue", "url": "YAHOO.widget.DualSlider.html#method_setMinValue", "type": "method"}, {"access": "protected", "host": "YAHOO.widget.Slider", "name": "_setRegionValue", "url": "YAHOO.widget.Slider.html#method__setRegionValue", "type": "method"}, {"access": "", "host": "YAHOO.widget.Slider", "name": "setRegionValue", "url": "YAHOO.widget.Slider.html#method_setRegionValue", "type": "method"}, {"access": "", "host": "YAHOO.widget.Slider", "name": "setStartSliderState", "url": "YAHOO.widget.Slider.html#method_setStartSliderState", "type": "method"}, {"access": "", "host": "YAHOO.widget.Slider", "name": "setThumbCenterPoint", "url": "YAHOO.widget.Slider.html#method_setThumbCenterPoint", "type": "method"}, {"access": "protected", "host": "YAHOO.widget.Slider", "name": "_setValue", "url": "YAHOO.widget.Slider.html#method__setValue", "type": "method"}, {"access": "", "host": "YAHOO.widget.Slider", "name": "setValue", "url": "YAHOO.widget.Slider.html#method_setValue", "type": "method"}, {"access": "", "host": "YAHOO.widget.DualSlider", "name": "setValues", "url": "YAHOO.widget.DualSlider.html#method_setValues", "type": "method"}, {"access": "private", "host": "YAHOO.widget.Slider", "name": "_silent", "url": "YAHOO.widget.Slider.html#property__silent", "type": "property"}, {"access": "", "host": "YAHOO.widget.Slider", "name": "slideEnd", "url": "YAHOO.widget.Slider.html#event_slideEnd", "type": "event"}, {"access": "", "host": "YAHOO.widget.DualSlider", "name": "slideEnd", "url": "YAHOO.widget.DualSlider.html#event_slideEnd", "type": "event"}, {"access": "", "host": "YAHOO.widget.Slider", "name": "Slider.ANIM_AVAIL", "url": "YAHOO.widget.Slider.html#property_Slider.ANIM_AVAIL", "type": "property"}, {"access": "", "host": "YAHOO.widget.Slider", "name": "Slider.SOURCE_KEY_EVENT", "url": "YAHOO.widget.Slider.html#property_Slider.SOURCE_KEY_EVENT", "type": "property"}, {"access": "", "host": "YAHOO.widget.Slider", "name": "Slider.SOURCE_SET_VALUE", "url": "YAHOO.widget.Slider.html#property_Slider.SOURCE_SET_VALUE", "type": "property"}, {"access": "", "host": "YAHOO.widget.Slider", "name": "Slider.SOURCE_UI_EVENT", "url": "YAHOO.widget.Slider.html#property_Slider.SOURCE_UI_EVENT", "type": "property"}, {"access": "", "host": "YAHOO.widget.Slider", "name": "slideStart", "url": "YAHOO.widget.Slider.html#event_slideStart", "type": "event"}, {"access": "", "host": "YAHOO.widget.DualSlider", "name": "slideStart", "url": "YAHOO.widget.DualSlider.html#event_slideStart", "type": "event"}, {"access": "", "host": "YAHOO.widget.Slider", "name": "SOURCE_SET_VALUE", "url": "YAHOO.widget.Slider.html#property_SOURCE_SET_VALUE", "type": "property"}, {"access": "", "host": "YAHOO.widget.Slider", "name": "SOURCE_UI_EVENT", "url": "YAHOO.widget.Slider.html#property_SOURCE_UI_EVENT", "type": "property"}, {"access": "", "host": "YAHOO.widget.SliderThumb", "name": "startOffset", "url": "YAHOO.widget.SliderThumb.html#property_startOffset", "type": "property"}, {"access": "", "host": "YAHOO.widget.Slider", "name": "thumb", "url": "YAHOO.widget.Slider.html#property_thumb", "type": "property"}, {"access": "", "host": "YAHOO.widget.Slider", "name": "thumbCenterPoint", "url": "YAHOO.widget.Slider.html#property_thumbCenterPoint", "type": "property"}, {"access": "private", "host": "YAHOO.widget.Slider", "name": "thumbMouseUp", "url": "YAHOO.widget.Slider.html#method_thumbMouseUp", "type": "method"}, {"access": "", "host": "YAHOO.widget.Slider", "name": "tickPause", "url": "YAHOO.widget.Slider.html#property_tickPause", "type": "property"}, {"access": "private", "host": "YAHOO.widget.SliderThumb", "name": "tickSize", "url": "YAHOO.widget.SliderThumb.html#property_tickSize", "type": "property"}, {"access": "", "host": "YAHOO.widget.Slider", "name": "toString", "url": "YAHOO.widget.Slider.html#method_toString", "type": "method"}, {"access": "", "host": "YAHOO.widget.SliderThumb", "name": "toString", "url": "YAHOO.widget.SliderThumb.html#method_toString", "type": "method"}, {"access": "", "host": "YAHOO.widget.Slider", "name": "type", "url": "YAHOO.widget.Slider.html#property_type", "type": "property"}, {"access": "", "host": "YAHOO.widget.Slider", "name": "unlock", "url": "YAHOO.widget.Slider.html#method_unlock", "type": "method"}, {"access": "private", "host": "YAHOO.widget.DualSlider", "name": "updateValue", "url": "YAHOO.widget.DualSlider.html#method_updateValue", "type": "method"}, {"access": "", "host": "YAHOO.widget.Slider", "name": "valueChangeSource", "url": "YAHOO.widget.Slider.html#property_valueChangeSource", "type": "property"}, {"access": "", "host": "YAHOO.widget.Slider", "name": "verifyOffset", "url": "YAHOO.widget.Slider.html#method_verifyOffset", "type": "method"}, {"access": "", "host": "YAHOO.widget.Slider", "name": "YAHOO.widget.Slider.getHorizDualSlider", "url": "YAHOO.widget.Slider.html#method_YAHOO.widget.Slider.getHorizDualSlider", "type": "method"}, {"access": "", "host": "YAHOO.widget.Slider", "name": "YAHOO.widget.Slider.getHorizSlider", "url": "YAHOO.widget.Slider.html#method_YAHOO.widget.Slider.getHorizSlider", "type": "method"}, {"access": "", "host": "YAHOO.widget.Slider", "name": "YAHOO.widget.Slider.getSliderRegion", "url": "YAHOO.widget.Slider.html#method_YAHOO.widget.Slider.getSliderRegion", "type": "method"}, {"access": "", "host": "YAHOO.widget.Slider", "name": "YAHOO.widget.Slider.getVertDualSlider", "url": "YAHOO.widget.Slider.html#method_YAHOO.widget.Slider.getVertDualSlider", "type": "method"}, {"access": "", "host": "YAHOO.widget.Slider", "name": "YAHOO.widget.Slider.getVertSlider", "url": "YAHOO.widget.Slider.html#method_YAHOO.widget.Slider.getVertSlider", "type": "method"}];
</script>
</body>
</html>
